Skip to content

Member lookup on a generic type binds only the looked-up name - #1454

Merged
Frotty merged 1 commit into
masterfrom
claude/member-lookup-binding
Oct 13, 2026
Merged

Frotty merged 1 commit into
masterfrom
claude/member-lookup-binding

Conversation

@Frotty

@Frotty Frotty commented Oct 13, 2026

Copy link
Copy Markdown
Member

WurstTypeNamedScope.nameLinks(String name) was nameLinks().get(name): it built the class's whole name table with every link bound to the type arguments (withTypeArgBinding, the // OPT maybe cache this builder) and then took one name. So every member function or variable lookup on a parameterised class or interface bound all of its members.

It now binds only the links of that name, in the order attrNameLinks().get(name) has them, which is exactly the list the full table held for the name (an ImmutableListMultimap built in entry order). NameResolution's member-variable lookup, which called nameLinks().get(name) itself, uses the single-name method. The whole bound table (nameLinks()) is unchanged for its users that need every name (inherited names in NameLinks).

A large map: building the bound tables was about 0.8 % of the build (type check and translation to IM); Jass output and object data identical.

No behaviour change, so no new test. Run locally: GenericsTests, GenericsWithTypeclassesTests, GenericsModuleTests, TypeClassTests, ClassesTests, ClassesExtTests, InterfaceTests, InterfaceExtendedTests, ModuleTests, NewFeatureTests, BugTests, FieldIterationTests, ClosureTests. One InterfaceTests case fails locally on Windows on master as well (pjass cannot open its output file: the test name plus the worktree path exceed the Windows path limit); it passes on Linux CI.

WurstTypeNamedScope.nameLinks(name) built the name table of the class with
every link bound to the type arguments and then took one name from it, so
every member lookup on a parameterised class or interface bound all of its
members. It binds only the links of that name now, in the same order, which
is what the table held for it. The member-variable lookup uses it too.

About 0.8 % of a large map's build (type check and translation); output
identical.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T09:39:53.745538Z 1e9af4b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 86f5398 into master Oct 13, 2026
2 checks passed
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