This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Transforming constructors with a compiler plug-in

No replies
Erkki Lindpere
Joined: 2008-12-19,
User offline. Last seen 42 years 45 weeks ago.

In every class where I have an additional constructor, I get errors like
this for the additional constructors when using a TypingTransformer in a
compiler plug-in:

Exception in thread "main" scala.tools.nsc.symtab.Types$TypeError:
called constructor's definition must precede calling constructor's
definition
at
scala.tools.nsc.typechecker.Contexts$Context.error(Contexts.scala:352)
at scala.tools.nsc.typechecker.Infer$Inferencer.error(Infer.scala:266)
at
scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:1602)
at
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
at
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
at scala.List$.loop$1(List.scala:300)
at scala.List$.mapConserve(List.scala:317)
at
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
at
scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:1432)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3121)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
...

Any idea what I could be doing wrong here?

Erkki

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland