Skip to content

Commit 5a336fe

Browse files
committed
Minor style improvements
1 parent cff586d commit 5a336fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11891,7 +11891,8 @@ namespace ts {
1189111891
// for the argument. In that case, we should check the argument.
1189211892
if (argType === undefined) {
1189311893
// If the parameter and argument are both functions and the parameter has fewer arguments than the argument,
11894-
// then this signature is not applicable. Exit early.
11894+
// then this signature is not applicable. Exit early to avoid fixing incorrect
11895+
// contextual types to the function expression parameters.
1189511896
if (!reportErrors && isAritySmaller(paramType, arg)) {
1189611897
return false;
1189711898
}
@@ -11922,6 +11923,8 @@ namespace ts {
1192211923
const sourceLengths = sourceSignatures.map(sig => !sig.hasRestParameter ? sig.parameters.length : Number.MAX_VALUE);
1192311924
return forEach(sourceLengths, len => len < targetParameterCount);
1192411925
}
11926+
11927+
return false;
1192511928
}
1192611929

1192711930
/**

0 commit comments

Comments
 (0)