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
interfaceBase{x: number}classC<TextendsBase>{constructor(readonlyx: T){}foo<UextendsBase>(y: U){if(y===this.x){}// <-- error: 'U' and 'T' have no overlap}}
π Actual behavior
An error is raised on the if clause.
This comparison appears to be unintentional because the types 'U' and 'T' have no overlap.(2367)
π Expected behavior
Both U and T are constrained by Base, so they conceivably could overlap, so comparing them should be OK (and as a side-effect, it'd be nice if the comparison also refined U to T inside the if block).