-
Notifications
You must be signed in to change notification settings - Fork 730
Open
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking
Description
Steps to reproduce
With default compiler options:
enum E {
Foo,
Bar,
}
type A = { type: 'a'; e: E }
type B = { type: 'b' }
type C = A & { e: E.Bar }
function fn(v: A | B | C): A | B | C {
return { ...v, e: E.Foo }
}Behavior with [email protected]
Typechecks successfully.
Behavior with tsgo
index.ts:10:18 - error TS2322: Type 'E.Foo' is not assignable to type 'E.Bar'.
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking