File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments