-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Open
Description
π Search Terms
"infer", "regression", "wide", "narrow"
π Version & Regression Information
- This changed between versions 5.9.3 and 6.0.2
- This changed in commit or PR ???
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about YES
- I was unable to test this on prior versions because N/A
β― Playground Link
π» Code
type AB = 'A' | 'B';
const DEFAULT: AB = 'A';
class C {
D = DEFAULT;
method() {
switch(this.D) {
case 'A': break;
case 'B': break;
}
}
}π Actual behavior
C.D infers to "A"
π Expected behavior
C.D infers to AB
Additional information about the issue
Somewhat common occurrence in Angular code.
Hundreds of instances of this class of error in Google.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels