This program causes a compiler crash (with -XDdev):
class Test {
public static <T extends U & Test, U> T max() {
return null;
}
}
java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol
at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1544)
at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1535)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2722)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2652)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2588)
at com.sun.tools.javac.comp.Attr.attribBounds(Attr.java:466)
at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:570)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:640)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:358)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:395)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2726)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2652)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2588)
at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1036)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
at com.sun.tools.javac.main.Main.compile(Main.java:366)
at com.sun.tools.javac.main.Main.compile(Main.java:292)
at com.sun.tools.javac.main.Main.compile(Main.java:283)
at com.sun.tools.javac.Main.compile(Main.java:69)
at com.sun.tools.javac.Main.main(Main.java:54)