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
classC<T>{constructor(readonlyx: T){}good<UextendsT>(y: U){if(y===this.x){}}bad<UextendsT|string>(y: U){if(y===this.x){}// <- OK in 4.7.4, error in 4.8.2}}
π Actual behavior
The code type-checks OK in 4.7.4.
In 4.8.2 error 2367 (types 'U' and 'T' have no overlap) is thrown on the if guard in bad().
π Expected behavior
T | string includes T, so there is overlap between the two sides of the comparison, therefore the diagnostic seems to be incorrect.