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
Bug Report
๐ Search Terms
typeguard exclude union
๐ Version & Regression Information
v4.6.2
โฏ Playground Link
Playground link with relevant code
๐ป Code
๐ Actual behavior
error
๐ Expected behavior
no error