Aladdin - Scala Bugtracking
[#803] project: compiler priority: low category: bug
submitter assigned to status date submitted
Burak Martin fixed 2006-11-07 00:37:42.0
subject [contrib #249] Compiler crash with inheritance, closure and override combination
code
class B(x : Int => Int) { def z = 0 }

class A(i : Int) extends B(y => i) {
  override def z = i
}

// here's an even shorter program 

class B(x : () => Int)
class A(i : Int) extends B(() => i) { i }
what happened
Compiler crash


java.lang.AssertionError: assertion failed: i not in List(value i$0)
        at scala.Predef$.assert(Predef.scala:98)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.parameterNamed$0(Constructors.scala:59)\

        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.parameter$0(Constructors.scala:55)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer$$anonfun$8.apply(Constructors.scala:175\
)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer$$anonfun$8.apply(Constructors.scala:174\
)
        at scala.List.map(List.scala:658)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transformClassTemplate(Constructors.sca\
la:174)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:192)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$26.apply(Trees.scala:1089)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$26.apply(Trees.scala:1087)
        at scala.List$.loop$0(List.scala:238)
        at scala.List$.mapConserve(List.scala:255)
        at scala.List$.loop$0(List.scala:242)
        at scala.List$.mapConserve(List.scala:255)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1087)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:972)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:972)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1095)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:971)
        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:194)
        at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1090)
        at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:218)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
        at scala.Iterator$class.foreach(Iterator.scala:316)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:220)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:207)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:469)
        at scala.tools.nsc.Global$Run.compile(Global.scala:535)
        at scala.tools.nsc.CompileServer$.session(CompileServer.scala:132)
        at scala.tools.util.SocketServer$$anonfun$0.apply(SocketServer.scala:65)
        at scala.tools.util.SocketServer$$anonfun$0.apply(SocketServer.scala:65)
        at scala.util.Fluid.withValue(Fluid.scala:63)
        at scala.Console$.withOut(Console.scala:79)
        at scala.Console$.withOut(Console.scala:97)
        at scala.tools.util.SocketServer.run(SocketServer.scala:64)
        at scala.tools.nsc.CompileServer$.main(CompileServer.scala:169)
        at scala.tools.nsc.CompileServer.main(CompileServer.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:96)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
error: fatal error (server aborted): assertion failed: i not in List(value i$0)
one error found


what expected Compilation
[back to overview]
Changes of this bug report
Martin  edited on  2006-11-10 19:00:42.0