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
#17765
length
[T]
T[]
T
Array<T>
ReadonlyArray
push: never; pop: never;
instanceof
#19671
Makes instanceof nominal
Changes to subtype reduction to accomodate this new behavior.
Take the following:
class A {} class B extends A {} class Q extends A { qProp: any; } let blah = Math.random() ? new B() : new Q();
Under old subtype reduction behavior, blah has type B; means the negative check for blah instanceof B gives you never:
blah
B
blah instanceof B
never
if (blah instanceof B) { blah; /* has type `B` */ } else { blah; /* has type `never` */ }
Under new behavior, we aren't as agressive; blah has type B | D
B | D
if (blah instanceof B) { blah; /* has type `B` */ } else { blah; /* has type `D` */ }
This is better, but it affects things like callability.
Symbol.instanceOf
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Stricter Tuple Types
#17765
length
property breaks fairly little[T]
instead ofT[]
.T
instead ofArray<T>
ReadonlyArray
instead.push: never; pop: never;
?instanceof
checks#19671
instanceof
has worked structurally since forever with us.Makes
instanceof
nominalChanges to subtype reduction to accomodate this new behavior.
Take the following:
Under old subtype reduction behavior,
blah
has typeB
; means the negative check forblah instanceof B
gives younever
:Under new behavior, we aren't as agressive;
blah
has typeB | D
This is better, but it affects things like callability.
Symbol.instanceOf
?The text was updated successfully, but these errors were encountered: