JDK-7034495 : Javac asserts on usage of wildcards in bounds
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-04-06
  • Updated: 2012-03-20
  • Resolved: 2011-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b142Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
interface A<T>
{
    T foo();
}

interface B<T>
{
   T foo();
}

interface C<T extends A<?> & B<?>> { }


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: isSubtype 15
	at com.sun.tools.javac.code.Types$5.visitType(Types.java:415)
	at com.sun.tools.javac.code.Types$5.visitType(Types.java:396)
	at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visitWildcardType(Types.java:3667)
	at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:440)
	at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3665)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:392)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:390)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:368)
	at com.sun.tools.javac.code.Types.isSubtypeUnchecked(Types.java:339)
	at com.sun.tools.javac.code.Types.isConvertible(Types.java:277)
	at com.sun.tools.javac.code.Types.isAssignable(Types.java:1601)
	at com.sun.tools.javac.code.Types.covariantReturnType(Types.java:3073)
	at com.sun.tools.javac.comp.Check.firstDirectIncompatibility(Check.java:1655)
	at com.sun.tools.javac.comp.Check.firstIncompatibility(Check.java:1608)
	at com.sun.tools.javac.comp.Check.checkCompatibleAbstracts(Check.java:1586)
	at com.sun.tools.javac.comp.Check.checkCompatibleSupertypes(Check.java:2062)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:3154)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3104)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3040)
	at com.sun.tools.javac.comp.Attr.attribBounds(Attr.java:562)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:3128)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3104)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3040)
	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:3014)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1182)
	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:870)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:829)
	at com.sun.tools.javac.main.Main.compile(Main.java:415)
	at com.sun.tools.javac.main.Main.compile(Main.java:329)
	at com.sun.tools.javac.main.Main.compile(Main.java:320)
	at com.sun.tools.javac.Main.compile(Main.java:76)
	at com.sun.tools.javac.Main.main(Main.java:61)



REPRODUCIBILITY :
This bug can be reproduced always.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/1092b67b3cad
29-04-2011

EVALUATION We will go for a short-term fix in 7 and for a more complete fix in 8 (see related CR 7040590).
29-04-2011