Skip to content

Commit 2b69b97

Browse files
committed
Always return on equal aliasSymbol
1 parent d328ea0 commit 2b69b97

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22417,10 +22417,13 @@ namespace ts {
2241722417
propagationType = savePropagationType;
2241822418
return;
2241922419
}
22420-
if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
22421-
// Source and target are types originating in the same generic type alias declaration.
22422-
// Simply infer from source type arguments to target type arguments.
22423-
inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments!, getAliasVariances(source.aliasSymbol));
22420+
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
22421+
if (source.aliasTypeArguments) {
22422+
// Source and target are types originating in the same generic type alias declaration.
22423+
// Simply infer from source type arguments to target type arguments.
22424+
inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments!, getAliasVariances(source.aliasSymbol));
22425+
}
22426+
// And if there weren't any type arguments, there's no reason to run inference as the types must be the same.
2242422427
return;
2242522428
}
2242622429
if (source === target && source.flags & TypeFlags.UnionOrIntersection) {

0 commit comments

Comments
 (0)