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

imports versus erasure of inner classes

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Future Project
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: specification
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      The problem of referring to a nonstatic class from a static context is the same when the name is available by virtue of being imported. Does an imported class name always have an erased outer?


      package p;

      import p.A.C;

      class A<T> {
          public class C {
              T x = null;
          }
      }

      class Main {
          {
              C c = null;
              c.x = "foo"; // what is the type of c.x?
          }
      }

        Attachments

          Activity

            People

            Assignee:
            abuckley Alex Buckley
            Reporter:
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: