RFR: 7033677: potential cast error in MemberEnter

Vicente Romero vromero at openjdk.org
Thu Feb 16 20:13:27 UTC 2023

On Thu, 16 Feb 2023 19:55:04 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:

> > not sure as the JLS, section: `7.5.1 Single-Type-Import Declarations` has this rule:
> > ```
> > SingleTypeImportDeclaration:
> >     import TypeName ;
> > ```
> Yes - but it then says:
> > The class or interface must be either a member of a named package, or a member of a class or interface whose outermost lexically enclosing class or interface declaration ([§8.1.3](https://docs.oracle.com/javase/specs/jls/se19/html/jls-8.html#jls-8.1.3)) is a member of a named package, or a compile-time error occurs.
> Also, the parser won't accept a single identifier.

yep the parser won't accept it, I was just not sure if the spec was missing some clarification but yes that's text clarifies the issue


PR: https://git.openjdk.org/jdk/pull/12606

More information about the compiler-dev mailing list