Closed
Description
Bug Report
π Search Terms
typeguard exclude union
π Version & Regression Information
v4.6.2
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about typeguards
β― Playground Link
Playground link with relevant code
π» Code
type AAA = {
c: 0
b: 1
} | {
c: Exclude<number, 0>
x: 1
}
const a = {} as unknown as AAA
if (a.c !== 0) a.x
π Actual behavior
error
Property 'x' does not exist on type 'AAA'.
Property 'x' does not exist on type '{ c: 0; b: 1; }'.
π Expected behavior
no error
Metadata
Metadata
Assignees
Labels
No labels