Aladdin - Scala Bugtracking
[#968] project: compiler priority: high category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2007-02-26 18:58:47.0
subject labdalift crash with locals
code
abstract class Foo {
  import scala.collection.immutable.Set
  private def f(xs: Set[Int], t: Option[Int]) = {
    val local = t
    xs.filter { case l => l != local }
  }
}
what happened
I set the priority to high because I could not find a workaround and it's a real showstopper.

Crash in lambda lift:
java.lang.Error: no-symbol does not have owner
        at scala.tools.nsc.symtab.Symbols$NoSymbol$.owner(Symbols.scala:1306)
        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.postTransform(LambdaLift.scala:378)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1223)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:46)\

        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:271)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1215)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:46)\

        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:271)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$19.apply(Trees.scala:1151)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$19.apply(Trees.scala:1151)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1271)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:33)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:27)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1150)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:46)\

        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:271)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$30.apply(Trees.scala:1265)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$30.apply(Trees.scala:1263)
        at scala.List$.loop$0(List.scala:243)
        at scala.List$.mapConserve(List.scala:260)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1263)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:409)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1177)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:46)\

        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:271)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$19.apply(Trees.scala:1151)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$19.apply(Trees.scala:1151)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1271)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:33)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:27)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1150)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:46)\

        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:271)
        at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:395)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$30.apply(Trees.scala:1265)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$30.apply(Trees.scala:1263)
        at scala.List$.loop$0(List.scala:243)
...
what expected successful compilation
[back to overview]
Changes of this bug report
Martin  edited on  2007-02-27 23:23:40.0
You would not believe it: It was because the val was named "local". lambda lifting turned this into local$0. This name clashed with the naming convention for `template dummies' which are named local$class-name. Crazy, no? I renamed template dummies to "".