-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
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
Suggestion Backlog Slog, 10/1/2020 #40963
Comments
Hello, with regards to destructuring type annotations. Do you have a link to the "guards" proposal? I looked around on TC 39 but couldn't find it. If the double colon is a no go can we come up with another usable token? Almost anything would be better than having to double type all destructured parameters to functions. I'm partial to |
[number, ...string, number]
)a
's variable-lengthnessfoo(a: number, b: number, c: number, ...more: number[])
foo(...arr, 1, 2, 3)
::
is part of a proposal called "guards"; avoid thisas
?function fn(%{ a: string, b: number })
excludeTypes
forceExclude
, not a simple filter@types/node
,excludeTypes
will not fix thistypes: []
is a good default in modern TStypes: []
in your tsconfig because if that didn't fix your problem, then this wouldn't eithertypes:
those that wouldn't get into your program via an import anywayNaN
typingNaN
exists, is it a subtype ofnumber
?number | NaN
is an evaporating union tonumber
, and this never does anything usefulNaN
, but very few of them do under reasonable arguments except in cases where people are already on guardextends
is the wrong syntax since it doesn't create a subtype;...
is betterAdvEvents.Start
andBasicEvents.Start
are identical; both refer to the same typeThe text was updated successfully, but these errors were encountered: