Repository navigation
Member lookup on a generic type binds only the looked-up name - #1454
Merged
Merged
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WurstTypeNamedScope.nameLinks(String name)wasnameLinks().get(name): it built the class's whole name table with every link bound to the type arguments (withTypeArgBinding, the// OPT maybe cache thisbuilder) 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 (anImmutableListMultimapbuilt in entry order).NameResolution's member-variable lookup, which callednameLinks().get(name)itself, uses the single-name method. The whole bound table (nameLinks()) is unchanged for its users that need every name (inherited names inNameLinks).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.