- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
compiler plugins
Tue, 2009-03-31, 23:36
Hello!
I'm a CS student from the University of Tartu, Estonia, and I'm trying to
develop a compiler plugin for Scala with some optimizations.
Could someone please shed some light on the status quo of compiler plugin
support.. the current code checked from live SVN doesn't seem to react to
compiler options like "-Xplugin-require:myPlugin" at all... is this
something currently under development/broken? Any plans to get it fixed
any time soon? Or maybe it's just that the doc is just out-dated? There
seem to be no comments on this issue in the source as well, not in the
obvious places to look for them, at least (Plugin.scala,
PluginComponent.scala).
Anyway, something is broken/under construction in live repo -- well,
that's quite natural, of course; and compiler plugins are working just
fine in 2.7.3. But.. mm... it is quite probably just me (and not a bug),
but once i set my plugin to run anywhere after the phase "erasure", i
start getting these kind of errors:
[scalac] scala.tools.nsc.symtab.Types$TypeError: package
#java#lang is not a legal prefix for a constructor
okay.. erasure deletes some type information.. that must be the reason..?
So.. this is intentional/unavoidable that custom plugins cannot be run
after that phase? Just asking just-in-case because as i'm not so deeply
familiar with your whole code-base, i think if it was some nasty bug i
could go gray before discovering the actual reason/work-around :). (I was
just looking for some phase after which i could insert my plugin which
would have structural type method invocations transformed to
ApplyDynamics).
With best wishes,
Sander Sõnajalg