Properly instantiate true type when extends type is any or unknown
This commit is contained in:
parent
454b4280b1
commit
5a567ad56d
1 changed files with 1 additions and 1 deletions
|
@ -10383,7 +10383,7 @@ namespace ts {
|
|||
// We attempt to resolve the conditional type only when the check and extends types are non-generic
|
||||
if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, TypeFlags.Instantiable | TypeFlags.GenericMappedType)) {
|
||||
if (inferredExtendsType.flags & TypeFlags.AnyOrUnknown) {
|
||||
return trueType;
|
||||
return instantiateType(root.trueType, combinedMapper || mapper);
|
||||
}
|
||||
// Return union of trueType and falseType for 'any' since it matches anything
|
||||
if (checkType.flags & TypeFlags.Any) {
|
||||
|
|
Loading…
Reference in a new issue