Skip to content

Commit e0c876e

Browse files
committed
Added a comment explaining the change in instantiateSignatureInContextOf
1 parent ff145a7 commit e0c876e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14896,6 +14896,8 @@ namespace ts {
1489614896
});
1489714897
const inferred = getInferredTypes(context);
1489814898
for (let i = 0; i < inferred.length; ++i) {
14899+
// If inference has failed, use the first constituent type. During checking, the other
14900+
// constituents will fail to match, resulting in a nice error message pointing it out.
1489914901
if (inferred[i] === unknownType) {
1490014902
inferred[i] = getInferenceCandidates(context, i)[0] || inferred[i];
1490114903
}

0 commit comments

Comments
 (0)