typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Process `@overload` tags only in limited contexts

Open ahejlsberg opened this issue 3 weeks ago • 0 comments

This PR changes our reparsing logic to only create synthetic overload declarations when @overload tags occur on function, method, or constructor declarations outside object literals.

The PR also fixes incorrect parsingContexts flag setting logic that apparently wasn't breaking anything.

With this PR we're no longer dumping overload signatures into the global scope in declarations files as can be seen in the baseline changes for jsFileAlternativeUseOfOverloadTag.js.

This PR supersedes #2221, which BTW doesn't work because it relies on following parent pointers that aren't yet set.

Fixes #2218.

ahejlsberg avatar Dec 07 '25 11:12 ahejlsberg