Skip to content

Commit a914d1c

Browse files
committed
Only return the substitute in substitution instantiation when assignability fails (rather than subtype)
1 parent 7ccc89b commit a914d1c

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
@@ -11295,7 +11295,7 @@ namespace ts {
1129511295
}
1129611296
else {
1129711297
const sub = instantiateType((<SubstitutionType>type).substitute, mapper);
11298-
if (sub.flags & TypeFlags.AnyOrUnknown || isTypeSubtypeOf(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) {
11298+
if (sub.flags & TypeFlags.AnyOrUnknown || isTypeAssignableTo(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) {
1129911299
return maybeVariable;
1130011300
}
1130111301
return sub;

0 commit comments

Comments
 (0)