Skip to content

Commit a65ebb2

Browse files
committed
Add a big comment
1 parent 5641e39 commit a65ebb2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30733,7 +30733,13 @@ namespace ts {
3073330733
}
3073430734

3073530735
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
30736-
// TODO(jakebailey): explain this, and maybe move getResolvedSignature's caching here.
30736+
// Preemptively cache the result; getResolvedSignature will do this after we return, but
30737+
// we need to ensure that the result is present for the error checks below so that if
30738+
// this signature is encountered again, we handle the circularity (rather than producing a
30739+
// different result which may produce no errors and assert). Callers of getResolvedSignature
30740+
// don't hit this issue becuase they only observe this result after it's had a chance to
30741+
// be cached, but the error reporting code below executes before getResolvedSignature sets
30742+
// resolvedSignature.
3073730743
getNodeLinks(node).resolvedSignature = result;
3073830744

3073930745
// No signatures were applicable. Now report errors based on the last applicable signature with

0 commit comments

Comments
 (0)