Fix cross-module -shared get/set accessor resolution gap#281
Merged
Conversation
2 tasks
ASDAlexander77
added a commit
that referenced
this pull request
Jul 22, 2026
super-index-access-gap-fix.md predicted that adding cross-module coverage for class indexers would reproduce the exact 2-bug shape PR #281 fixed for accessors. It did: 1. DeclarationPrinter never re-emitted a class's index signature ([x: T]: U;) when reprinting a -shared @dllimport declaration, so a reimporting module's ClassInfo::indexes stayed empty and `obj[i]`/`super[i]` failed with "Class member '.index' can't be found". 2. ClassIndexAccess had no isDynamicImport fallback (unlike ClassMethodAccess/ClassAccessorAccess), so AOT -shared linking tried to statically resolve the indexer's get/set symbols against an import library that -shared mode never links, failing with "undefined symbol ... dllimport". Routed through the already-existing (but previously unused) ThisIndirectIndexAccessorOp instead, mirroring ClassAccessorAccess's resolveAccessorFunc pattern. New export_class_indexer.ts/import_class_indexer.ts cross-module test pair (compile, -shared compile, -jit -shared tiers). 796/796 green. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
get/setaccessor syntax across a module boundary - only the underlying mangledget_x/set_xfuncOps as ordinary methods - so property-style access (obj.x,super.x) on a dynamically-imported class never populated the reconstructed class's accessor list ("Class member 'x' can't be found").ClassAccessorAccessalways emitted a compile-time constant symbol reference for the get/set call, which needs real static/dllimport linkage - but a plain-sharedimporter never links against the exporter's.lib(cross-module symbols resolve entirely at runtime).ClassMethodAccessalready had a 3-tier runtime-resolution fallback for this;ClassAccessorAccessnever got the equivalent, so it failed at link time (lld: undefined symbol: __declspec(dllimport) ...).-shared/-jit-sharedaccessor tests (previously disabled) are re-enabled and pass.Test plan
ctest -C Debug -R class-accessor- 9/9 pass (including both re-enabled-sharedtiers)ctest -C Debug -j8- 791/791 pass, no regressions