File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -5197,23 +5197,23 @@ namespace ts {
5197
5197
}
5198
5198
5199
5199
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))) {
5204
5204
5205
5205
if (reportErrors) {
5206
5206
let sourceParamText = source.typePredicate.parameterName;
5207
5207
let targetParamText = target.typePredicate.parameterName;
5208
5208
let sourceTypeText = typeToString(source.typePredicate.type);
5209
5209
let targetTypeText = typeToString(target.typePredicate.type);
5210
5210
5211
- if (hasDifferentParameterIndex ) {
5211
+ if (parametersHaveDifferentIndexes ) {
5212
5212
reportError(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1,
5213
5213
sourceParamText,
5214
5214
targetParamText);
5215
5215
}
5216
- else if (hasDifferentTypes ) {
5216
+ else if (typesAreNotSubtypes ) {
5217
5217
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1,
5218
5218
sourceTypeText,
5219
5219
targetTypeText);
You can’t perform that action at this time.
0 commit comments