-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
π Search Terms
- in operator
- generic
- intersection
- object
- never
π Version & Regression Information
- This changed between versions 4.7 and 4.8
β― Playground Link
Playground link with relevant code
π» Code
const f3 = <A,>(value: A) => {
if (
typeof value === "object" &&
value !== null &&
"prop" in value
) {
value;
// ^?
// TS 4.7: `A`
// TS 4.8: `never`
// Expected: `A & object`
}
};
π Actual behavior
See above.
π Expected behavior
See above.
samhh and erheron
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue