@@ -19051,7 +19051,7 @@ namespace ts {
19051
19051
19052
19052
// If the given contextual type contains instantiable types and if a mapper representing
19053
19053
// return type inferences is available, instantiate those types using that mapper.
19054
- function instantiateContextualType(contextualType: Type | undefined, node: Expression , contextFlags?: ContextFlags): Type | undefined {
19054
+ function instantiateContextualType(contextualType: Type | undefined, node: Node , contextFlags?: ContextFlags): Type | undefined {
19055
19055
if (contextualType && maybeTypeOfKind(contextualType, TypeFlags.Instantiable)) {
19056
19056
const inferenceContext = getInferenceContext(node);
19057
19057
// If no inferences have been made, nothing is gained from instantiating as type parameters
@@ -23363,7 +23363,7 @@ namespace ts {
23363
23363
nextType && isUnitType(nextType)) {
23364
23364
const contextualType = !contextualSignature ? undefined :
23365
23365
contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? undefined : returnType :
23366
- getReturnTypeOfSignature(contextualSignature);
23366
+ instantiateContextualType( getReturnTypeOfSignature(contextualSignature), func );
23367
23367
if (isGenerator) {
23368
23368
yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, IterationTypeKind.Yield, isAsync);
23369
23369
returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, IterationTypeKind.Return, isAsync);
0 commit comments