The following code crashes javac b73:
class U {}
interface I {}
class Child extends U implements I {}
interface Foo<T extends U & I> {
Foo testMethod() ;
}
public class expr74601m2 {
public static void main(String argv[]) {
Foo<Child> t1 = new Foo<>() {
public Foo testMethod() { return null; }
}.testMethod();
}
}
Here is the output:
An exception has occurred in the compiler (1.7.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError
at com.sun.tools.javac.jvm.ClassWriter.enterInner(ClassWriter.java:1014)
at com.sun.tools.javac.jvm.ClassWriter.assembleClassSig(ClassWriter.java:369)
at com.sun.tools.javac.jvm.ClassWriter.assembleSig(ClassWriter.java:297)
at com.sun.tools.javac.jvm.ClassWriter.assembleSig(ClassWriter.java:396)
at com.sun.tools.javac.jvm.ClassWriter.assembleClassSig(ClassWriter.java:388)
at com.sun.tools.javac.jvm.ClassWriter.assembleSig(ClassWriter.java:297)
at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1675)
at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1597)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:696)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1393)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1361)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:851)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:810)
at com.sun.tools.javac.main.Main.compile(Main.java:400)
at com.sun.tools.javac.main.Main.compile(Main.java:318)
at com.sun.tools.javac.main.Main.compile(Main.java:309)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.sun.tools.javac.Main.main(Main.java:67)
Everything compiles fine when I do one of the following:
- remove .testMethod()
- remove extends U & I
- use <Child> instead of <>.
This test will be integrated into jck soon (probably b26).
-
-
examples 2 and 3 are incorrect, please ignore.