Typescript bad highlighting with `typeof x extends...`
ap32 opened this issue · comments
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.