Skip to content

Commit 10beac2

Browse files
committed
Delay instantiation of signature return type
`getReturnTypeOfSignature` correctly handles an un-instantiated signature, but `instantiateSignature` used to eagerly instantiate the return type. This caused an infinite recursion in #16233. Now `instantiateSignature` doesn't instantiate the return type, but relies on `getReturnTypeOfSignature` to do it.
1 parent 68122ea commit 10beac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8038,7 +8038,7 @@ namespace ts {
80388038
const result = createSignature(signature.declaration, freshTypeParameters,
80398039
signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper),
80408040
instantiateList(signature.parameters, mapper, instantiateSymbol),
8041-
instantiateType(signature.resolvedReturnType, mapper),
8041+
/*resolvedReturnType*/ undefined,
80428042
freshTypePredicate,
80438043
signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes);
80448044
result.target = signature;

0 commit comments

Comments
 (0)