RFR: 7033677: potential cast error in MemberEnter

Archie L. Cobbs duke at openjdk.org
Thu Feb 16 19:57:26 UTC 2023


On Thu, 16 Feb 2023 19:45:44 GMT, Vicente Romero <vromero 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.

-------------

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


More information about the compiler-dev mailing list