function example<
T extends { bar: 2 }
>(
v: T
): typeof v & { baz: 3 } {
type V = typeof v;
type U0 = V extends { foo: 1 } ? true : false; // works ok
type U1 = (typeof v) extends { foo: 1 } ? true : false; // works ok
type U2 = typeof v extends { foo: 1 } ? true : false; // bad highlighting
return Object.assign({ baz: 3 }, v) as V & { baz: 3 }
}
const v = example({ foo: 1, bar: 2 } as const);
Right now I believe the problem is not with the theme, but with the incorrectly provided scope. Please close the issue if so. Might be worth creating an issue in the vscode repository.
It can be slightly worse, i got this:![Screenshot_20220723_210627](https://user-images.githubusercontent.com/12585904/180617583-04d0b84a-2e5a-46a8-8318-01f8bc4a750f.png)