@@ -12885,7 +12885,7 @@ namespace ts {
12885
12885
// and we need to handle "each" relations before "some" relations for the same kind of type.
12886
12886
if (source.flags & TypeFlags.Union) {
12887
12887
result = relation === comparableRelation ?
12888
- someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive), isIntersectionConstituent ) :
12888
+ someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive)) :
12889
12889
eachTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive));
12890
12890
}
12891
12891
else {
@@ -12923,7 +12923,7 @@ namespace ts {
12923
12923
//
12924
12924
// - For a primitive type or type parameter (such as 'number = A & B') there is no point in
12925
12925
// breaking the intersection apart.
12926
- result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false, /*isIntersectionConstituent*/ true );
12926
+ result = someTypeRelatedToType(<IntersectionType>source, target, /*reportErrors*/ false);
12927
12927
}
12928
12928
if (!result && (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable)) {
12929
12929
if (result = recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent)) {
@@ -13202,14 +13202,14 @@ namespace ts {
13202
13202
return result;
13203
13203
}
13204
13204
13205
- function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean, isIntersectionConstituent: boolean ): Ternary {
13205
+ function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary {
13206
13206
const sourceTypes = source.types;
13207
13207
if (source.flags & TypeFlags.Union && containsType(sourceTypes, target)) {
13208
13208
return Ternary.True;
13209
13209
}
13210
13210
const len = sourceTypes.length;
13211
13211
for (let i = 0; i < len; i++) {
13212
- const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, /*headMessage*/ undefined, isIntersectionConstituent );
13212
+ const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1);
13213
13213
if (related) {
13214
13214
return related;
13215
13215
}
@@ -21598,13 +21598,13 @@ namespace ts {
21598
21598
checkMode: CheckMode,
21599
21599
reportErrors: boolean,
21600
21600
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
21601
- ): ReadonlyArray<Diagnostic> | undefined {
21601
+ ) {
21602
21602
21603
21603
const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true };
21604
21604
if (isJsxOpeningLikeElement(node)) {
21605
21605
if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) {
21606
21606
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors");
21607
- return errorOutputContainer.errors || emptyArray ;
21607
+ return errorOutputContainer.errors || [] ;
21608
21608
}
21609
21609
return undefined;
21610
21610
}
@@ -21619,7 +21619,7 @@ namespace ts {
21619
21619
const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
21620
21620
if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) {
21621
21621
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors");
21622
- return errorOutputContainer.errors || emptyArray ;
21622
+ return errorOutputContainer.errors || [] ;
21623
21623
}
21624
21624
}
21625
21625
const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1;
@@ -21637,7 +21637,7 @@ namespace ts {
21637
21637
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) {
21638
21638
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
21639
21639
maybeAddMissingAwaitInfo(arg, checkArgType, paramType);
21640
- return errorOutputContainer.errors || emptyArray ;
21640
+ return errorOutputContainer.errors || [] ;
21641
21641
}
21642
21642
}
21643
21643
}
@@ -21647,7 +21647,7 @@ namespace ts {
21647
21647
if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) {
21648
21648
Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors");
21649
21649
maybeAddMissingAwaitInfo(errorNode, spreadType, restType);
21650
- return errorOutputContainer.errors || emptyArray ;
21650
+ return errorOutputContainer.errors || [] ;
21651
21651
}
21652
21652
}
21653
21653
return undefined;
@@ -22038,7 +22038,7 @@ namespace ts {
22038
22038
}
22039
22039
}
22040
22040
else {
22041
- const allDiagnostics: (readonly DiagnosticRelatedInformation[]) [] = [];
22041
+ const allDiagnostics: DiagnosticRelatedInformation[][] = [];
22042
22042
let max = 0;
22043
22043
let min = Number.MAX_VALUE;
22044
22044
let minIndex = 0;
0 commit comments