Aladdin - Scala Bugtracking
[#311] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2004-03-18 16:35:23.0
subject [contrib #30] Compiler crashes on secondary constructor accessing value parameter of the class
code
class A(i : int) {
  def this() = { this(0) ; Console.println(i) ; }
}
what happened
Exception in thread "main" java.lang.AssertionError: value i in constructor A
        at scalac.transformer.LambdaLift$FreeVars.markFree(LambdaLift.java:178)
        at scalac.transformer.LambdaLift$FreeVars.markFree(LambdaLift.java:182)
        at scalac.transformer.LambdaLift$FreeVars.markFree(LambdaLift.java:182)
        at scalac.transformer.LambdaLift$FreeVars.transform(LambdaLift.java:262)
        at scalac.ast.Transformer.transform(Transformer.java:281)
        at scalac.ast.Transformer.transform(Transformer.java:211)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:145)
        at scalac.transformer.LambdaLift$FreeVars.transform(LambdaLift.java:268)
        at scalac.ast.Transformer.transform(Transformer.java:161)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:145)
        at scalac.transformer.LambdaLift$FreeVars.transform(LambdaLift.java:268)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:41)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:116)
        at scalac.transformer.LambdaLift$FreeVars.transform(LambdaLift.java:235)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:41)
        at scalac.transformer.OwnerTransformer.transformTemplateStat(OwnerTransformer.java:87)
        at scalac.transformer.OwnerTransformer.transformTemplateStats(OwnerTransformer.java:76)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:68)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:100)
        at scalac.transformer.LambdaLift$FreeVars.transform(LambdaLift.java:235)
        at scalac.ast.Transformer.transform(Transformer.java:281)
        at scalac.transformer.OwnerTransformer.apply(OwnerTransformer.java:35)
        at scalac.transformer.LambdaLift$FreeVars.initialize(LambdaLift.java:315)
        at scalac.transformer.LambdaLift.apply(LambdaLift.java:54)
        at scalac.transformer.LambdaLiftPhase.apply(LambdaLiftPhase.java:28)
        at scalac.Global.compile(Global.java:301)
        at scalac.Global.compile(Global.java:273)
        at scala.tools.scalac.Main$.main1(Main.scala:35)
        at scala.tools.scalac.Main$.main(Main.scala:27)
        at scala.tools.scalac.Main.main(Main.scala:27)
what expected Error message for illegal refering to a value parameter of the class.
[back to overview]
Changes of this bug report
Nikolay  edited on  2004-03-30 12:34:34.0
Assigned to Philippe
Nikolay  edited on  2004-04-05 18:37:20.0
Changed the "subject" and "what expected" fields. Assigned to Martin.
Martin  edited on  2004-04-15 17:18:29.0