8000 Use more accurate variable name. · prmdeveloper/TypeScript@152400d · GitHub
[go: up one dir, main page]

Skip to content

Commit 152400d

Browse files
Use more accurate variable name.
1 parent 23bec86 commit 152400d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5197,23 +5197,23 @@ namespace ts {
51975197
}
51985198

51995199
if (source.typePredicate && target.typePredicate) {
5200-
let hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex;
5201-
let hasDifferentTypes: boolean;
5202-
if (hasDifferentParameterIndex ||
5203-
(hasDifferentTypes = !isTypeSubtypeOf(source.typePredicate.type, target.typePredicate.type))) {
5200+
let parametersHaveDifferentIndexes = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex;
5201+
let typesAreNotSubtypes: boolean;
5202+
if (parametersHaveDifferentIndexes ||
5203+
(typesAreNotSubtypes = !isTypeSubtypeOf(source.typePredicate.type, target.typePredicate.type))) {
52045204

52055205
if (reportErrors) {
52065206
let sourceParamText = source.typePredicate.parameterName;
52075207
let targetParamText = target.typePredicate.parameterName;
52085208
let sourceTypeText = typeToString(source.typePredicate.type);
52095209
let targetTypeText = typeToString(target.typePredicate.type);
52105210

5211-
if (hasDifferentParameterIndex) {
5211+
if (parametersHaveDifferentIndexes) {
52125212
reportError(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1,
52135213
sourceParamText,
52145214
targetParamText);
52155215
}
5216-
else if (hasDifferentTypes) {
5216+
else if (typesAreNotSubtypes) {
52175217
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1,
52185218
sourceTypeText,
52195219
targetTypeText);

0 commit comments

Comments
 (0)
0