[#267] | project: compiler | priority: high | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Martin | Philippe | fixed | 2004-01-05 12:50:18.0 | |
subject | assertin error in maxeboxing | |||
code |
package expAbstractData; /** A base class consisting of * - a root trait (i.e. abstract class) `Exp' with an `eval' function * - an abstract type `exp' bounded by `Exp' * - a concrete instance class `Num' of `Exp' for numeric literals */ trait Base { type exp <: Exp; trait Exp { def eval: int } class Num(v: int): exp extends Exp { val value = v; def eval = value } } object testBase extends Base with Executable { type exp = Exp; val term = new Num(2); System.out.println(term.eval); } /** Data extension: An extension of `Base' with `Plus' expressions */ trait BasePlus extends Base { class Plus(l: exp, r: exp): exp extends Exp { val left = l; val right = r; def eval = left.eval + right.eval } } /** Operation extension: An extension of `Base' with 'show' methods. */ trait Show extends Base { type exp <: Exp1; trait Exp1 extends Exp { def show: String; } class Num1(v: int): exp extends Num(v) with Exp1 { def show = value.toString(); } } /** Operation extension: An extension of `BasePlus' with 'show' methods. */ trait ShowPlus extends BasePlus with Show { class Plus1(l: exp, r: exp): exp extends Plus(l, r) with Exp1 { def show = left.show + " + " + right.show } } |
|||
what happened | Exception in thread "main" java.lang.AssertionError: unit : /home/odersky/scala/test/pos/abstract-data.scala clasz : expAbstractData.ShowPlus.Plus1$class member : expAbstractData.ShowPlus.Plus1$class.show owner : expAbstractData.ShowPlus.Plus1$class.show tree : Plus1$class.this.right().show tree.pos : 53:41 tree.symbol : expAbstractData.Show.Exp1.show tree.type : ()String at scalac.checkers.TreeChecker.selection(TreeChecker.java:413) at scalac.checkers.TreeChecker.function(TreeChecker.java:367) at scalac.checkers.TreeChecker.expression(TreeChecker.java:292) at scalac.checkers.TreeChecker.vapply(TreeChecker.java:351) at scalac.checkers.TreeChecker.expression(TreeChecker.java:284) at scalac.checkers.TreeChecker.member(TreeChecker.java:176) at scalac.checkers.TreeChecker.member(TreeChecker.java:143) at scalac.checkers.TreeChecker.template(TreeChecker.java:111) at scalac.checkers.TreeChecker.member(TreeChecker.java:155) at scalac.checkers.TreeChecker.member(TreeChecker.java:143) at scalac.checkers.TreeChecker.template(TreeChecker.java:111) at scalac.checkers.TreeChecker.template(TreeChecker.java:91) at scalac.checkers.TreeChecker.template(TreeChecker.java:121) at scalac.checkers.TreeChecker.template(TreeChecker.java:91) at scalac.checkers.TreeChecker.check(TreeChecker.java:81) at scalac.transformer.MakeBoxingExplicitPhase.apply(MakeBoxingExplicitPhase.java:46) at scalac.Global.compile(Global.java:306) at scalac.Global.compile(Global.java:278) at scala.tools.scalac.Main$.main(sources/scala/tools/scalac/Main.scala:33) at scala.tools.scalac.Main.main(sources/scala/tools/scalac/Main.scala) |
|||
what expected | succesful compilation | |||
[back to overview] |
Martin edited on 2004-01-05 17:39:49.0 |
Philippe edited on 2004-01-07 18:45:04.0 |
Fixed by new version of |