Bug Report
π Search Terms
in operator
- generic
- object
π Version & Regression Information
- This changed between versions 4.8 and 4.9
β― Playground Link
Playground link with relevant code
π» Code
const f = <P extends object>(a: P & {}) => {
// Unexpected error:
// Type 'P & {}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator.ts(2638)
"foo" in a;
};
π Actual behavior
See code comment above.
π Expected behavior
See code comment above.