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

[lworld] default value creation should not impose raw types on users.

    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

      Follow up of Rémi's comment from http://mail.openjdk.java.net/pipermail/valhalla-dev/2018-September/004998.html excerpted here:

      static member accesses are defined on raw type and you want the default value to be a non-erased type,
      you currently use the inference to try to bridge the gap so it fails when using var.

        __ByValue class Foo<E> {
          E value;
          Foo(E value) { this.value = value; }
        }
        var foo = Foo.default; // doesn't compile

      A way to fix that is to allow to '.default' to be applied on type and not on raw class
      in that case var will work:
        var foo = Foo<String>.default;

      We need something like that anyway if Foo is any-fied.

      // ------------------

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: