Aladdin - Scala Bugtracking
[#1287] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Sean Iulian fixed 2007-08-23 09:57:50.0
subject lazy val in trait method crash
code
package test
trait Outer {
  def foo = {
    lazy val next = 10 + 1
    next
  }
}

what happened
java.lang.AssertionError: assertion failed: no method allowed here: value next$0true final private     
	at scala.Predef$.assert(Predef.scala:96)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$postTrans\
form(Mixin.scala:755)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$34.apply(Mixin.scala:785)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$34.apply(Mixin.scala:785)
	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:85)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:785)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1322)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1284)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1284)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$24.apply(Trees.scala:1267)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$24.apply(Trees.scala:1266)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1379)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1265)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1373)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1371)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1371)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1282)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1357)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1254)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1254)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1379)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1253)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1373)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1371)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.List$.loop$0(List.scala:248)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1371)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$20.apply(Trees.scala:1250)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$20.apply(Trees.scala:1250)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1379)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1249)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1374)
	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:245)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:233)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:233)
	at scala.Iterator$class.foreach(Iterator.scala:375)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:255)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:233)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:540)
	at scala.tools.nsc.Global$Run.compile(Global.scala:625)
	at ch.epfl.lamp.sdt.build.ScalaCompilerManager$ScalaCompiler.compile(ScalaCompilerManager.java:263)
	at ch.epfl.lamp.sdt.build.ScalaProjectBuilder.build(ScalaProjectBuilder.java:153)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

what expected
[back to overview]
Changes of this bug report
Iulian  edited on  2007-08-23 10:14:18.0
This is probably for me, reassigned.
Iulian  edited on  2007-08-23 11:55:56.0