Repository navigation
TSLANG_ISSUES 18: a namespace member access looks in the namespace first - #569
Merged
Merged
Conversation
`ns.value()` after a local `const value = ...` in the same function
resolved `value` as an identifier with the namespace current, which
finds locals first: the local wasn't callable ("not a function to
call"). The access now resolves the name in the namespace first and
falls back to the old lookup.
Found in native_ts_graphics' nvrhi_direct.ts (TSLANG_ISSUES.md 18).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
added a commit
that referenced
this pull request
Oct 13, 2026
13, 14, 15 and 18 are fixed by #572, #568, #570 and #569. For 16, `%` is fixed by #571 and `/` stays a number. 17 is answered (`Deref(p[i]) = v` stores) and its error names that form since #573. 5 and 6 stay open: they are design questions, not bugs. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
added a commit
that referenced
this pull request
Oct 17, 2026
* `ns.name` is the namespace's member or an error #569 looked the name up in the namespace first, then fell back to the general lookup, which searched the calling function's locals and the outer namespaces: `ns.missing` with a local `missing` in scope, or `ns.outer()` with a root-level `outer`, compiled and used those. The access now takes only what the namespace has; a name it hasn't got is "Can't resolve property 'missing' of type ns". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * `M.name` of `import * as M` is the module's top-level name M is a namespace with nothing in it, whose names are declared at the top level; the fallback the previous commit removed was how they were found. Such a namespace is marked, and its access looks in the root namespace, still not in the calling function's locals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.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.
TSLANG_ISSUES.md 18:
ns.value()resolved to a localvaluedeclared earlier in the function ("not a function to call").The namespace case of property access set the namespace current and resolved the name as an identifier, which finds locals first. It now calls
resolveIdentifierInNamespacefirst and keeps the old lookup as the fallback.Test:
00ns_member_shadowed.ts(function, const and nested-namespace members shadowed by locals; a local named like the namespace is still the local).Follow-up, not changed here: a name the namespace doesn't have still falls back to the general lookup, so
ns.missingwith a localmissingresolves to the local instead of failing.Full Release suite with all six TSLANG_ISSUES fixes together: 4074/4074.
🤖 Generated with Claude Code