Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in LambdaLift #5444

Closed
scabug opened this issue Feb 8, 2012 · 7 comments
Closed

Crash in LambdaLift #5444

scabug opened this issue Feb 8, 2012 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Feb 8, 2012

class Test {
  {
    val a = new {
      def m1() {
        trait T {
          def m() = ()
        }
      }

      def m2() {
        trait T {
          def m() = ()
        }
      }
    }
  }

  {
    val a = new {
      def m1() {
        trait T {
          def m() = ()
        }
      }

      def m2() {
        trait T {
          def m() = ()
        }
      }
    }
  }
}
error: 
     while compiling:  Test.scala
       current phase:  lambdalift
     library version:  version v2.10.0-M1-169-g76cd8c433a
    compiler version:  version v2.10.0-M1-169-g76cd8c433a
  reconstructed args:  

uncaught exception during compilation: java.lang.AssertionError
error: java.lang.AssertionError: assertion failed
  at scala.Predef$.assert(Predef.scala:146)
  at scala.reflect.internal.Scopes$Scope.enterUnique(Scopes.scala:123)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.liftDef(LambdaLift.scala:373)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.postTransform(LambdaLift.scala:383)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1277)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1189)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:1175)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:1173)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1172)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1277)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1187)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1261)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1159)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1158)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1157)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1277)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1189)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1169)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1168)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1167)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1277)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1189)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1$$anonfun$apply$2.apply(Trees.scala:1276)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1$$anonfun$apply$2.apply(Trees.scala:1276)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1276)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1187)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1261)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1159)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1158)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1157)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1277)
  at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1275)
  at scala.collection.immutable.List.loop$1(List.scala:151)
  at scala.collection.immutable.List.mapConserve(List.scala:167)
  at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1275)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:482)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformStats(LambdaLift.scala:54)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1153)
  at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1153)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
  at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1152)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
  at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1284)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:51)
  at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:269)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.preTransform(LambdaLift.scala:456)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transform(LambdaLift.scala:462)
  at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:223)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.scala$tools$nsc$transform$LambdaLift$LambdaLifter$$super$transformUnit(LambdaLift.scala:487)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter$$anonfun$transformUnit$1.apply$mcV$sp(LambdaLift.scala:487)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter$$anonfun$transformUnit$1.apply(LambdaLift.scala:487)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter$$anonfun$transformUnit$1.apply(LambdaLift.scala:487)
  at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:120)
  at scala.tools.nsc.transform.LambdaLift$LambdaLifter.transformUnit(LambdaLift.scala:487)
  at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
  at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:408)
  at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:374)
  at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:368)
  at scala.collection.Iterator$class.foreach(Iterator.scala:687)
  at scala.collection.AbstractIterator.foreach(Iterator.scala:1112)
  at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:368)
  at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1196)
  at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1169)
  at scala.tools.nsc.Global$Run.compileSources(Global.scala:1163)
  at scala.tools.nsc.Global$Run.compile(Global.scala:1293)
  at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
  at scala.tools.nsc.Main$.doCompile(Main.scala:81)
  at scala.tools.nsc.Driver.process(Driver.scala:52)
  at scala.tools.nsc.Driver.main(Driver.scala:65)
  at scala.tools.nsc.Main.main(Main.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 8, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@cvogt said:
simpler reproduce code:

class Test{
    def a() {
      trait T {
        def x() = ()
      }
    }
    def b() {
      trait T {
        def y() = ()
      }
    }
    def c() {
      trait T {
        def z() = ()
      }
    }
}

Traits require identical names to reproduce.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@cvogt said:
does not crash in 2.9.1, crash reproduced in trunk (fb5f42648a61de2cdfc318c341ab28ea5662ca20)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@paulp said:
I introduced this no doubt in 5cbd7d06eb . I think crashing is a feature - look at the compilation products in 2.9.1. It may not crash but it's hard to be real confident it's doing the right thing:

Test$T$1.class
Test$T$2$class.class
Test$T$2.class
Test$T$3.class
Test$T$class$1.class
Test$T$class$2.class
Test$T$class$3.class
Test$T$class.class
Test.class

Test$T$2$class and Test$T$class$2 ! And look inside:

// this is one of them
public static void y(Test$T$2);
// this is the other one
public static void z(Test$T$2);

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@paulp said:
Or, maybe it's too late for me and I'm blending the classfiles from two compiles. I thought all my more recent ones crashed. Never mind, nothing to see here...

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@paulp said:
Thanks for the legwork everyone.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Feb 14, 2012

@paulp said:
eb8556ca66

@scabug scabug closed this Feb 14, 2012
@scabug scabug added this to the 2.10.0-M1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.