Fix substitution types of indexed access types of substitution types (#47791)

* Fix substitution types of indexed access types of substitution types

* Add tests

* Fix accidental unindentation
This commit is contained in:
Andrew Branch
2022-02-07 15:53:13 -08:00
committed by GitHub
parent 867470ca26
commit d8ac54bfb1
9 changed files with 126 additions and 1 deletions

View File

@@ -13506,7 +13506,7 @@ namespace ts {
function getImpliedConstraint(type: Type, checkNode: TypeNode, extendsNode: TypeNode): Type | undefined {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, (checkNode as TupleTypeNode).elements[0], (extendsNode as TupleTypeNode).elements[0]) :
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
undefined;
}