Skip to content

Commit 69580c4

Browse files
committed
Filter outer type parameters (similar to anonymous types)
1 parent 992870a commit 69580c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8278,7 +8278,9 @@ namespace ts {
82788278
const links = getNodeLinks(node);
82798279
if (!links.resolvedType) {
82808280
const checkType = getTypeFromTypeNode(node.checkType);
8281-
const outerTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);
8281+
const aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
8282+
const allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);
8283+
const outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : filter(allOuterTypeParameters, tp => isTypeParameterPossiblyReferenced(tp, node));
82828284
const root: ConditionalRoot = {
82838285
node,
82848286
checkType,
@@ -8290,7 +8292,7 @@ namespace ts {
82908292
outerTypeParameters,
82918293
instantiations: undefined,
82928294
aliasSymbol: getAliasSymbolForTypeNode(node),
8293-
aliasTypeArguments: getAliasTypeArgumentsForTypeNode(node)
8295+
aliasTypeArguments
82948296
};
82958297
links.resolvedType = getConditionalType(root, /*mapper*/ undefined);
82968298
if (outerTypeParameters) {

0 commit comments

Comments
 (0)