Domain: check: Variance RelationshipsHelp WantedPossible Improvement
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
union extends
ð Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about unions and extends
⯠Playground Link
ð» Code
type A = { a: 1, b: string} | { a: 2 , b: string};
type B = { a: 2, c: string };
type C = { a: 1 | 2, b: string };
type Works<T extends A = C> = T;
type DoesNotWork<T extends A | B = C> = T;
ð Actual behavior
An error tells that C does not extend A | B
ð Expected behavior
No error since C extends A and therefore extends A | B
Additional information about the issue
No response