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

[lworld] Javac does not compile test/hotspot/jtreg/runtime/valhalla/valuetypes/UnsafeTest.java anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      After the changes for JDK-8237072 got integrated, javac does not compile UnsafeTest anymore.

      Please note that javac on Valhalla lworld branch head does not implement any provisions from https://mail.openjdk.java.net/pipermail/valhalla-spec-experts/2020-April/001292.html when it comes to bounds checking.

      (i.e "... If we have a bound: class Foo<T extends U> { } then this was historically satisfied if T <: U. In Valhalla, this is amended in the same way as (1): X is within bound `T extends U` if X.ref <: U"
      was implemented, but withdrawn before commit)

      Here is an extracted shorter version that shows the problem:

      public class X {

          public static <T> long size(Class<T> c) {
              return 0;
          }

          static inline class V {
              int x = 42;
          }

          public static void main(String[] args) {
              size(V.class);
          }
      }

      // upon compiling we get:

      X.java:12: error: method size in class X cannot be applied to given types;
              size(V.class);
              ^
        required: Class<T>
        found: Class<V>
        reason: inference variable T has incompatible bounds
          equality constraints: V
          lower bounds: Object
        where T is a type-variable:
          T extends Object declared in method <T>size(Class<T>)
      1 error

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              sadayapalam Srikanth Adayapalam
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: