Aladdin - Scala Bugtracking
[#101] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Philippe fixed 2003-09-02 16:40:14.0
subject Erasure crash in type tests/casts
code
object T {
    def bar(a: Any): java.lang.Object = {
    	if (a.isInstanceOf[Boolean])
    		new java.lang.Boolean(a.asInstanceOf[Boolean])
    	else
    		a.asInstanceOf[AnyRef];
    }
}
what happened
Compiler crashes with:
Exception in thread "main" scalac.ApplicationError: illegal kind 17
        at scalac.util.Debug.abort(Debug.java:45)
        at scalac.backend.Primitives.getInstanceTestSymbol(Primitives.java:808)
        at scalac.backend.Primitives.getInstanceTestSymbol(Primitives.java:793)
        at scalac.transformer.Erasure.transform(Erasure.java:429)
        at scalac.transformer.Erasure.transform(Erasure.java:558)
        at scalac.transformer.Erasure.transform(Erasure.java:459)
        at scalac.transformer.Erasure.transform(Erasure.java:558)
        at scalac.transformer.Erasure.transform(Erasure.java:618)
        at scalac.transformer.Erasure.transform(Erasure.java:373)
        at scalac.transformer.Erasure.transform(Erasure.java:558)
        at scalac.transformer.Erasure.transform(Erasure.java:618)
        at scalac.transformer.Erasure.transform(Erasure.java:346)
        at scalac.transformer.Erasure.transform(Erasure.java:558)
        at scalac.ast.Transformer.transform(Transformer.java:276)
        at scalac.transformer.Erasure.transform(Erasure.java:567)
        at scalac.transformer.Erasure.transform(Erasure.java:336)
        at scalac.transformer.Erasure.transform(Erasure.java:558)
        at scalac.ast.Transformer.transform(Transformer.java:276)
        at scalac.transformer.Erasure.apply(Erasure.java:63)
        at scalac.ast.Transformer.apply(Transformer.java:62)
        at scalac.transformer.ErasurePhase.apply(ErasurePhase.java:51)
        at scalac.Global.compile(Global.java:277)
        at scalac.Global.compile(Global.java:255)
        at scalac.Main.main(Main.java:32)
what expected Compiler positive.
[back to overview]
Changes of this bug report
Philippe  edited on  2003-09-03 10:28:23.0
Hacked in some additional tests to handle this case and also all casts to Array[...].