We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#55739
(background is #52921)
tsc
createSourceFile
@see
@link
#33014 #33912
Imagine (from our handbook)
/** * @param idOrName {string | number} */ function createLabel(idOrName) { if (typeof idOrName === "number") { return { id: idOrName }; } return { name: idOrName }; }
Could do overloads
function createLabel(id: number): LabelWithId; function createLabel(name: string): LabelWithName; function createLabel(isOrName: string | number): LabelWithId | LabelWithName; function createLabel(isOrName: string | number): LabelWithId | LabelWithName { // ... }
Conditional types can describe what will happen - but today you cannot usually assign to them without a type assertion/cast.
return
Easy to get this stuff wrong.
So do we have agree we should fix this?
Have a prototype working for conditional types - can't cover every case, requires distributive conditional and the like.
There's also a question of type soundness - conditional types aren't quite sound.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
API for Skipping JSDoc
#55739
(background is #52921)
tsc
can skip JSDoc so that fewer nodes need to be allocated.createSourceFile
while also skipping JSDoc nodes.@see
or@link
, or any comment outside of TS/TSX.Enabling Implementations of Functions with Overloads and Conditional Return Types
#33014
#33912
Imagine (from our handbook)
Could do overloads
Conditional types can describe what will happen - but today you cannot usually assign to them without a type assertion/cast.
return
expression.Easy to get this stuff wrong.
So do we have agree we should fix this?
Have a prototype working for conditional types - can't cover every case, requires distributive conditional and the like.
There's also a question of type soundness - conditional types aren't quite sound.
The text was updated successfully, but these errors were encountered: