Overloaded constructors: 'TValue' not assignable to 'string' #53722
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Fix Available
A PR has been opened for this issue
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
🔎 Search Terms
constructor, overload, TValue, jsdoc
🕗 Version & Regression Information
@overload
's interactions with constructors #52577 was not implemented (there was no reliable way to define overloads for class constructors)Recent PR fixed the use of jsdoc-defined overloads for class constructors
@overload
doesn't work for constructors #52477@overload
): Improve@overload
's interactions with constructors #52577That seems to have made it in to recent VS Code release; I'm using:
⏯ Playground Link
(Updated to exhibit error): Playground link
💻 Code
🙁 Actual behavior
In VS Code editor, if I try and instantiate my class using code like this:
This happens:
Hovering the error shows:
The code still works fine when used in node, the issue is constrained to the VS Code editor which seems to think
TValue
is a type rather than a template.Possibly related to comment here about type checking being broken: #52477 (comment)
🙂 Expected behavior
TValue
is a template and thus should adopt the@type {StringKeyMap<string>}
defined for#tags
.The text was updated successfully, but these errors were encountered: