Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8008200

java/lang/Class/asSubclass/BasicUnit.java fails to compile

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: tools
    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b100

      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
      --------------------------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mcimadamore Maurizio Cimadamore
                Reporter:
                chegar Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: