Stacktrace:
http://pastebin.com/PhYEehGM
At line 57 of the trace you see
pluginTestFramework.CompilerWithUserPlugins$class.compileCode(CompilerWithUserPlugins.scala:56)
line 54-56 of my code are
val compiler: Global = global
val run/*: compiler.type#Run*/ = new compiler.Run()
run compileSources(sources.toList)
Any ideas?
It sounds like using a global before it is fully initialized. You
can't even look at it funny until definitions.init is complete. I
hypothesize that you are looking at it funny somewhere.
> line 54-56 of my code are
> val compiler: Global = global
> val run/*: compiler.type#Run*/ = new compiler.Run()
> run compileSources(sources.toList)
That looks fine (instantiating a Run calls definitions.init), who else
has access to val compiler?
> It sounds like using a global before it is fully initialized. You
> can't even look at it funny until definitions.init is complete. I
> hypothesize that you are looking at it funny somewhere.
How do I initialize global? Calling definitions.init results directly in
an exception:
val compiler = {
val g = new Global(settings, null)
g.definitions.init
g
}
java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:89)
at
scala.tools.nsc.symtab.Symbols$TypeHistory.<init>(Symbols.scala:2190)
at
scala.tools.nsc.symtab.Symbols$Symbol.info_$eq(Symbols.scala:747)
at
scala.tools.nsc.symtab.Symbols$TypeSymbol.info_$eq(Symbols.scala:1945)
(...)
How do I ensure definitions.init is complete or how do I look at global
in a non-funny manner?
That looks fine (instantiating a Run calls definitions.init), who else
has access to val compiler?
How do I initialize global?