Merge pull request #15512 from Microsoft/release-2.3_fixDefaultTypeParameter

[React-Release 2.3] Enable default type parameter in React Component class
This commit is contained in:
Yui
2017-05-01 19:29:04 -07:00
committed by GitHub
18 changed files with 458 additions and 1 deletions

View File

@@ -13397,7 +13397,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);
}
/**