You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically the idea is that we only narrow when the type a variable is declared with (the "declared type") determines if we should narrow using discriminated unions.
What is desired is that once something is narrowed to a discriminatable union type, we should correctly narrow on each discrimination.
What is the crux of the change?
Currently tracks only the last union that's been encountered.
Question is whether or not adding in a stack or "limited-depth buffer" is appropriate.
Conclusion: Need to actually give feedback on the implementation.
Errors for Certain Asssertions and Never-Returning Functions
#33622
We now need to do control flow analysis for statement-expression level calls.
But resolving the expression that's being called (i.e.
f
inf(x, y, z)
) can kick off more control-flow analysis.Instead of erroring on the call, why not call
But this also forces you to add an explicit annotation for something like
The alternative is that we just "let control flow analysis do its thing" but that causes breaks in the compiler itself.
These declarations really should never be considered circularity errors but they are.
Maybe you kind of want to get the type of something as if control flow had never taken effect?
Discuss offline.
Do we need more time to figure this out?
Alternative PR which breaks existing code is not viable.
Resolution
Narrowing non-declared union types
#30593
Improved Template String Support in Type-Checking
#32064
ts-nocheck in TS files
#33383
ts-ignore
in both JS and TS files.ts-nocheck
in JS files, but not TS files!The text was updated successfully, but these errors were encountered: