For React Component class, we fill in missing type parameter and instantiate the constructor signature with the new type arguments.

This commit is contained in:
Kanchalai Tanglertsampan 2017-05-01 11:53:13 -07:00 committed by Yui T
parent 975bc765c0
commit 1e806cea01

View File

@ -13438,7 +13438,18 @@ namespace ts {
}
}
return getUnionType(map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true);
const instantiatedSignatures = [];
for (const signature of signatures) {
if (signature.typeParameters) {
const typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0);
instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments));
}
else {
instantiatedSignatures.push(signature);
}
}
return getUnionType(map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true);
}
/**