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
{{ message }}
Repository navigation
Multiple issues with template literal type narrowing and relations #46125
functionf1(x: `foo-${string}`,y: `${string}-bar`){if(x===y){// Wrongly reports error that types don't overlap (they do, e.g. 'foo-xxx-bar')}}functionf2(x: string,y: `foo-${string}` |'bar'){if(x===y){x;// Narrowed to 'bar', should be `foo-${string}` | 'bar'}}functionf3(x: string,y: `foo-${string}`){if(x==='foo-test'){x;// Narrowed to 'foo-test'}if(y==='foo-test'){y;// Not narrowed but should be}}
That was very kind of you to attempt to classify fixed prefixes - and fixed mid?/post-fixes too. I would have thought that classifying fixed prefixes alone would be sufficient.
Activity
craigphicks commentedon Sep 29, 2021
That was very kind of you to attempt to classify fixed prefixes - and fixed mid?/post-fixes too. I would have thought that classifying fixed prefixes alone would be sufficient.