mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 02:45:24 -05:00
T extends unknown ? X : Y should eagerly resolve to X
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user