Skip to content

Commit 5a567ad

Browse files
committed
Properly instantiate true type when extends type is any or unknown
1 parent 454b428 commit 5a567ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10383,7 +10383,7 @@ namespace ts {
1038310383
// We attempt to resolve the conditional type only when the check and extends types are non-generic
1038410384
if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, TypeFlags.Instantiable | TypeFlags.GenericMappedType)) {
1038510385
if (inferredExtendsType.flags & TypeFlags.AnyOrUnknown) {
10386-
return trueType;
10386+
return instantiateType(root.trueType, combinedMapper || mapper);
1038710387
}
1038810388
// Return union of trueType and falseType for 'any' since it matches anything
1038910389
if (checkType.flags & TypeFlags.Any) {

0 commit comments

Comments
 (0)