Aladdin - Scala Bugtracking
[#81] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Martin fixed 2003-07-25 23:52:46.0
subject LazyTreeCopier cannot handle type selections from types
code
class A {
    val b: A#B = new B;
    class B {}
}
what happened
When type members are used as non-dependent types via the # operator, the LazyTreeCopier crashes with a ClassCas\
tException:
Exception in thread "main" java.lang.ClassCastException
        at scalac.ast.LazyTreeCopier.Select(LazyTreeCopier.java:377)
        at scalac.typechecker.Analyzer.transformSelect(Analyzer.java:1408)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:2233)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1661)
        at scalac.typechecker.Analyzer.defineSym(Analyzer.java:973)
        at scalac.typechecker.Analyzer$LazyTreeType.complete(Analyzer.java:631)
        at scalac.symtab.Symbol.info(Symbol.java:581)
        at scalac.symtab.Symbol.initialize(Symbol.java:549)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1690)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1661)
        at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1465)
        at scalac.typechecker.Analyzer.transformTemplate(Analyzer.java:1518)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1725)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1661)
        at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1465)
        at scalac.typechecker.Analyzer.apply(Analyzer.java:113)
        at scalac.ast.Transformer.apply(Transformer.java:66)
        at scalac.ast.Transformer.apply(Transformer.java:62)
        at scalac.typechecker.Analyzer.apply(Analyzer.java:57)
        at scalac.typechecker.AnalyzerPhase.apply(AnalyzerPhase.java:118)
        at scalac.Global.compile(Global.java:276)
        at scalac.Global.compile(Global.java:252)
        at scalac.Main.main(Main.java:32)
what expected No compile-time error, no crash.
[back to overview]
Changes of this bug report
Philippe  edited on  2003-07-28 12:56:16.0
- Reassigned to Martin. The problem is that Analyzer.transformSelect is invoked with a tree that is not a Select but a SelectFromType.
Martin  edited on  2003-07-31 12:02:22.0