JDK-8008200 : java/lang/Class/asSubclass/BasicUnit.java fails to compile
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-02-14
  • Updated: 2013-07-25
  • Resolved: 2013-07-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 8
8 b100Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Description
From Maurizio:

"This is a known inference failure introduced by this changeset of mine:

    author    mcimadamore
    Tue Feb 12 19:25:09 2013 +0000 (19 hours ago)
    changeset 1556    2154ed9ff6c8
    parent 1555    073696f59241
    child 1557    bc456436c613
    8007464: Add graph inference support
    Summary: Add support for more aggressive type-inference scheme
    Reviewed-by: jjg

I think we'd have to live with that one for the time being, as the test is running into a rough edges of the new inference scheme that still needs to be 100% fleshed out."

--------------------------
#section:compile
----------messages:(3/234)----------
command: compile -Xlint:unchecked -Werror /Users/aurora/sandbox/testbase/test/java/lang/Class/asSubclass/BasicUnit.java
reason: User specified action: run compile -Xlint:unchecked -Werror BasicUnit.java 
elapsed time (seconds): 0.066
----------direct:(15/768)----------
/Users/aurora/sandbox/testbase/test/java/lang/Class/asSubclass/BasicUnit.java:49: error: method factory in class BasicUnit cannot be applied to given types;
        factory(Class.forName("MyInt").asSubclass(Int.class)).main();
        ^
  required: Class<T>
  found: Class<CAP#1>
  reason: cannot infer type-variable(s) T,U
    (argument mismatch; Class<CAP#2> cannot be converted to Class<CAP#3>)
  where T,U are type-variables:
    T extends Int declared in method <T>factory(Class<T>)
    U extends Object declared in method <U>asSubclass(Class<U>)
  where CAP#1,CAP#2,CAP#3 are fresh type-variables:
    CAP#1 extends Int from capture of ? extends Int
    CAP#2 extends Int from capture of ? extends Int
    CAP#3 extends Int from capture of ? extends Int
1 error
result: Failed. Compilation failed: Compilation failed


test result: Failed. Compilation failed: Compilation failed
--------------------------
Comments
RULE java/lang/Class/asSubclass/BasicUnit.java CompilationError Compilation failed
28-02-2013