Skip to content

Resolve a type name only where the enclosing class's member types are in scope - #8186

Closed
mernst wants to merge 9 commits into
resolve-type-name-local-anonymousfrom
resolve-type-name-member-scope
Closed

mernst wants to merge 9 commits into
resolve-type-name-local-anonymousfrom
resolve-type-name-member-scope

Conversation

@mernst

@mernst mernst commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Based on #8185.

A class's member types, declared and inherited, are in scope only in its body -- not in its annotations, its type parameter section, or its supertype names, and not in the arguments of the object creation expression that declares an anonymous class. Test the child of the enclosing declaration that contains the name, rather than testing only whether the name is the supertype name.

Also include the implicit superclass java.lang.Enum in an enum's supertypes, because it declares the member type Enum.EnumDesc.

Adds tests for a name in an anonymous class's arguments and for a member type that an unnameable enum inherits.

🤖 Generated with Claude Code

… in scope

A class's member types, declared and inherited, are in scope only in its
body -- not in its annotations, its type parameter section, or its supertype
names, and not in the arguments of the object creation expression that
declares an anonymous class.  Test the child of the enclosing declaration
that contains the name, rather than testing only whether the name is the
supertype name.

Also include the implicit superclass `java.lang.Enum` in an enum's
supertypes, because it declares the member type `Enum.EnumDesc`.

Add tests for a name in an anonymous class's arguments and for a member type
that an unnameable enum inherits.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mernst and others added 8 commits September 16, 2026 12:52
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
@mernst mernst closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant