mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
T extends unknown ? X : Y should eagerly resolve to X
This commit is contained in:
parent
ac6fa9ccee
commit
7247d8e33a
@ -8984,6 +8984,9 @@ namespace ts {
|
||||
if (checkType === wildcardType || extendsType === wildcardType) {
|
||||
return wildcardType;
|
||||
}
|
||||
if (extendsType === getTopType()) {
|
||||
return instantiateType(root.trueType, mapper);
|
||||
}
|
||||
// If this is a distributive conditional type and the check type is generic we need to defer
|
||||
// resolution of the conditional type such that a later instantiation will properly distribute
|
||||
// over union types.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user