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

terrible diagnostic for missing superclass instance on new of inner class

    XMLWordPrintable

Details

    • mantis
    • generic
    • solaris_7

    Description

      The diagnostic for this program is terrible.

      frog:~/workspaces/test/mysterious $ cat -n T.java
           1 class T {
           2 Object x = new A.B();
           3 }
           4
           5
           6 class A {
           7 class B {
           8 B() { }
           9 }
          10 }
      frog:~/workspaces/test/mysterious $ newjavac T.java
      T.java:2: not an enclosing class: A
          Object x = new A.B();
                     ^
      1 error
      frog:~/workspaces/test/mysterious $

      Attachments

        Activity

          People

            gafter Neal Gafter
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: