-
-
Notifications
You must be signed in to change notification settings - Fork 679
isUnion incorrect behavior #1351
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
let's say there is a type
type TestType =
| { optionalField?: number; test1: number; test2: string }
| { test1: number; test2: string };so
type OptionalFieldType = TestType['optionalField'];=> TS2339: Property optionalField does not exist on type TestType
=> its correct, BUT:
IsUnion<TestType> = false
const test: IsUnion<TestType> = true;=> TS2322: Type true is not assignable to type false
but TestType - union....
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working