Aladdin - Scala Bugtracking
[#1137] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2007-05-23 21:42:18.0
subject objects in methods in traits crash
code
package test;
trait Test {
  def f = {
    object tokens1
    object hello {
      def foo = tokens1
    }
    ()
  }
}
what happened
sean-mcdirmid:~/workspace/test13/src mcdirmid$ ../../scala/build/quick/bin/scalac -d ../bin test/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: no method allowed here: object tokens1$0f\
alse final    
	at scala.Predef$.assert(Predef.scala:90)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$postTrans\
form(Mixin.scala:635)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$29.apply(Mixin.scala:665)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$29.apply(Mixin.scala:665)
	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:83)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:665)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1272)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:664)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1213)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1212)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1326)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1211)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:664)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$35.apply(Trees.scala:1320)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$35.apply(Trees.scala:1318)
	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:1318)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1232)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:664)
	at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1304)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$22.apply(Trees.scala:1200)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$22.apply(Trees.scala:1200)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1326)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1199)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:664)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$35.apply(Trees.scala:1320)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$35.apply(Trees.scala:1318)
	at scala.List$.loop$0(List.scala:243)
	at scala.List$.mapConserve(List.scala:260)
	at scala.List$.loop$0(List.scala:247)
	at scala.List$.mapConserve(List.scala:260)
	at scala.List$.loop$0(List.scala:247)
	at scala.List$.mapConserve(List.scala:260)
	at scala.List$.loop$0(List.scala:247)
	at scala.List$.mapConserve(List.scala:260)
	at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1318)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1196)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1196)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1326)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1195)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:664)
	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1321)
	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:241)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:230)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:230)
	at scala.Iterator$class.foreach(Iterator.scala:364)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:245)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:230)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:498)
	at scala.tools.nsc.Global$Run.compile(Global.scala:572)
	at scala.tools.nsc.Main$.process(Main.scala:57)
	at scala.tools.nsc.Main$.main(Main.scala:77)
	at scala.tools.nsc.Main.main(Main.scala)
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2007-05-30 18:13:13.0