Aladdin - Scala Bugtracking
[#648] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2006-06-30 19:28:04.0
subject compiler crash in lambda lift
code
import scala.tools.nsc.symtab.Flags
import scala.tools.nsc.transform.Transform

abstract class Detach extends Transform {
  import global._
  class DetachTransformer extends Transformer {
    def foo(clazz: Symbol): Scope =
      new Scope(
        clazz.tpe.members map { sym =>
          val newAcc = sym.cloneSymbol
          newAcc.setFlag(Flags.SYNTHETIC)
        }
     )
  }
}
what happened
exception when transforming sym.cloneSymbol
exception when transforming sym.cloneSymbol()
exception when transforming val newAcc$0: scala.tools.nsc.symtab.Symbols#Symbol = sym.cloneSymbol()
exception when transforming {
  val newAcc$0: scala.tools.nsc.symtab.Symbols#Symbol = sym.cloneSymbol();
  newAcc$0.setFlag(2097152L)
}
exception when transforming final def apply(sym: scala.tools.nsc.symtab.Symbols#Symbol): scala.tools.nsc.symtab.\
Symbols#Symbol = {  val newAcc$0: scala.tools.nsc.symtab.Symbols#Symbol = sym.cloneSymbol();
  newAcc$0.setFlag(2097152L)
}
[...]
Exception in thread "main" java.lang.Error
        at scala.tools.nsc.symtab.Symbols$NoSymbol$.owner(Symbols.scala:1079)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.outer(LambdaLift.scala:74)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$\
enclMethOrClass(LambdaLift.scala:105)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$0(LambdaLift.scala:270)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.proxy(LambdaLift.scala:283)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.proxyRef(LambdaLift.scala:301)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.postTransform(LambdaLift.scala:377)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:393)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1016)
[...]
what expected no crash
[back to overview]
Changes of this bug report
Stephane  edited on  2006-06-30 19:28:59.0
Stephane  edited on  2006-07-04 15:10:05.0
added retyping test in function
typedBlock