You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native compiler API resolves a default-parameter reference to a body function binding #65090
A reference in a default parameter resolves to a function declared inside the function body, rather than the outer variable used at runtime. This reproduces with the maintained native compiler API, independently of the legacy 6.0 API.
Reproduction
In an empty directory run npm install typescript@7.0.2, save the following as repro.mjs, and run node repro.mjs:
The symbol for styles in value = styles.root should resolve to the outer VariableDeclaration, matching the runtime parameter-initializer scope. The body function binding is not visible from that initializer.
Compiler-API consumers following the returned declaration can otherwise associate a reference with the wrong runtime binding.
History
The legacy-API report #65048 was closed because the 6.0 API is no longer maintained and a runnable reproduction was missing. This new report provides a complete runnable reproduction against the native 7.0.2 API.
Activity
test: add go-to-definition coverage for default-param outer bindings
fix(binder): resolve default-param refs to outer bindings, not body