Improve @overload error message to include host function name#3315
Draft
Improve @overload error message to include host function name#3315
@overload error message to include host function name#3315Conversation
Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/ad0c0211-7d53-4973-815a-aed0690ba3af Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve @overload error message to mention name of host function
Improve Apr 1, 2026
@overload error message to include host function name
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.
TS7012 for JSDoc
@overloadtags didn't include the host function name, making it less actionable than the equivalent TypeScript overload error.Before:
This overload implicitly returns the type 'any' because it lacks a return type annotation.After:
This overload of 'id' lacks a return-type annotation and implicitly has an 'any' return type.Changes
extraDiagnosticMessages.json: Overrides TS submodule code 7012 with a two-parameter format"This overload of '{0}' lacks a return-type annotation and implicitly has an '{1}' return type."— the extra messages file takes precedence over the submodule during generation.diagnostics_generated.go: Regenerated; oldThis_overload_implicitly_returns_the_type_0_...replaced byThis_overload_of_0_lacks_a_return_type_annotation_and_implicitly_has_an_1_return_type.checker.go: At theNodeFlagsReparsedbranch (reparsed@overloadsynthetic function declarations), passesDeclarationNameToString(GetNameOfDeclaration(declaration))as{0}and the widened type as{1}. The name is always non-nil at this point since anonymous declarations are handled by the earlierName() == nilguard.jsFileMethodOverloads3andtemplateInsideCallbackbaselines; addedjsFileMethodOverloads3.errors.txt.diffto record the intentional divergence from the upstream TS submodule baseline.