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

[lworld] Trouble creating an anonymous value class with diamond syntax

    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

      As reported by Remi in valhalla-dev:

      The diamond syntax doesn't seems to work with an anonymous value class.

      ComparatorBenchMark.java:85: error: method does not override or implement a method from a supertype
          return new value Function<>() {

      it works if i specify the type arguments.

      Trouble arises from the rule that all public methods of an anonymous class must override a super method. The compiler generated method longHashCode does not.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: