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

Spurious error when constructor reference mention an interface type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 8
    • tools
    • b82
    • Verified

    Description

      This program

      import java.util.*;

      interface SAM {
          Object m();
      }

      class Test {
          SAM s = SAM::new;
      }

      Gives:

      Test.java:8: error: {0} is abstract; cannot be instantiated
          SAM s = SAM::new;
                  ^
      1 error


      Error message should be improved.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: