Aladdin - Scala Bugtracking
[#1248] project: compiler priority: high category: bug
submitter assigned to status date submitted
Gilles Iulian fixed 2007-07-27 16:18:58.0
subject Lazy val implementing abstract val crashes mixiner
code
trait A { val f: AnyRef }
new A { lazy val f = null }
what happened
Exception in thread "main" scala.MatchError: Test$B.this.f()
        at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$22.apply(Mixin.scala:581)
        at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$22.apply(Mixin.scala:578)
        at scala.List.map(List.scala:683)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.lazifyOwnFields$0(Mixin.scala:578)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.addNewDefs(Mixin.scala:595)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$po\
stTransform(Mixin.scala:682)
        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.transformTemplate(Trees.scala:1311)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1209)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$21.apply(Trees.scala:1209)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1333)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1208)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:784)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1327)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1325)
        ...
what expected Successful compilation.
[back to overview]
Changes of this bug report
Iulian  edited on  2007-08-06 15:17:30.0
Fixed. Funny thing, it was because of bridge methods (so the concrete 'f' has type 'Null' instead of AnyRef).