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

field initialized with lambda in annotation types doesn't compile

    XMLWordPrintable

Details

    • b91
    • 8
    • b102
    • generic
    • generic
    • Verified

    Description

      The following test fails with compile-time error (jdk8 b92):

      ----------------
      interface fint { int get(); }

      @interface atype {
        fint fld = ()->(fld==null?0:1);
      }

      @atype class T {}
      ----------------

      Output:
      t.java:8: error: annotation atype is missing value for the attribute lambda$0
      @atype class T {}
      ^
      1 error


      Failing JCK tests:

      lang/INTF/intf018/intf01802m11/intf01802m11.html
      lang/INTF/intf018/intf01803m11/intf01803m11.html

      Attachments

        Activity

          People

            mcimadamore Maurizio Cimadamore
            larbouzo Leonid Arbuzov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: