Skip to content

Commit 95736c0

Browse files
committed
Ignore related info in diagnostic deduplication
1 parent 61d8a8d commit 95736c0

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3944,7 +3944,7 @@ namespace ts {
39443944
diagnostics = nonFileDiagnostics;
39453945
}
39463946

3947-
insertSorted(diagnostics, diagnostic, compareDiagnostics);
3947+
insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
39483948
}
39493949

39503950
function getGlobalDiagnostics(): Diagnostic[] {

tests/baselines/reference/jsxSpreadOverwritesAttributeStrict.errors.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ tests/cases/conformance/jsx/file.tsx(20,23): error TS2783: 'b' is specified more
66
tests/cases/conformance/jsx/file.tsx(21,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
77
tests/cases/conformance/jsx/file.tsx(21,23): error TS2783: 'd' is specified more than once, so this usage will be overwritten.
88
tests/cases/conformance/jsx/file.tsx(22,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
9-
tests/cases/conformance/jsx/file.tsx(22,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
109
tests/cases/conformance/jsx/file.tsx(22,23): error TS2783: 'd' is specified more than once, so this usage will be overwritten.
1110

1211

1312
!!! error TS2318: Cannot find global type 'CallableFunction'.
1413
!!! error TS2318: Cannot find global type 'NewableFunction'.
15-
==== tests/cases/conformance/jsx/file.tsx (8 errors) ====
14+
==== tests/cases/conformance/jsx/file.tsx (7 errors) ====
1615
import React = require('react');
1716

1817
interface Props {
@@ -53,9 +52,6 @@ tests/cases/conformance/jsx/file.tsx(22,23): error TS2783: 'd' is specified more
5352
~~~~~
5453
!!! error TS2783: 'a' is specified more than once, so this usage will be overwritten.
5554
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:29: This spread always overwrites this property.
56-
~~~~~
57-
!!! error TS2783: 'a' is specified more than once, so this usage will be overwritten.
58-
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:40: This spread always overwrites this property.
5955
~~~~~
6056
!!! error TS2783: 'd' is specified more than once, so this usage will be overwritten.
6157
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:40: This spread always overwrites this property.

tests/baselines/reference/objectSpreadNegative.errors.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(28,36): error TS111
1010
tests/cases/conformance/types/spread/objectSpreadNegative.ts(28,53): error TS1117: An object literal cannot have multiple properties with the same name.
1111
tests/cases/conformance/types/spread/objectSpreadNegative.ts(32,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
1212
tests/cases/conformance/types/spread/objectSpreadNegative.ts(37,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
13-
tests/cases/conformance/types/spread/objectSpreadNegative.ts(37,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
1413
tests/cases/conformance/types/spread/objectSpreadNegative.ts(39,14): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
1514
tests/cases/conformance/types/spread/objectSpreadNegative.ts(41,53): error TS2783: 'd' is specified more than once, so this usage will be overwritten.
1615
tests/cases/conformance/types/spread/objectSpreadNegative.ts(43,7): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
@@ -27,7 +26,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(69,9): error TS2339
2726
tests/cases/conformance/types/spread/objectSpreadNegative.ts(74,11): error TS2339: Property 'a' does not exist on type '{}'.
2827

2928

30-
==== tests/cases/conformance/types/spread/objectSpreadNegative.ts (23 errors) ====
29+
==== tests/cases/conformance/types/spread/objectSpreadNegative.ts (22 errors) ====
3130
let o = { a: 1, b: 'no' }
3231

3332
/// private propagates
@@ -91,9 +90,6 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(74,11): error TS233
9190
~~~~~~~
9291
!!! error TS2783: 'b' is specified more than once, so this usage will be overwritten.
9392
!!! related TS2785 tests/cases/conformance/types/spread/objectSpreadNegative.ts:37:16: This spread always overwrites this property.
94-
~~~~~~~
95-
!!! error TS2783: 'b' is specified more than once, so this usage will be overwritten.
96-
!!! related TS2785 tests/cases/conformance/types/spread/objectSpreadNegative.ts:37:23: This spread always overwrites this property.
9793
let combinedMid: { a: number, b: string, c: boolean } =
9894
{ ...o3, b: 'ok', ...o4 }
9995
~~~~~~~

tests/cases/fourslash/insertReturnStatementInDuplicateIdentifierFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
goTo.marker();
77

88
// Function with bodies can only merge with classes
9-
// Class declaration cannot implement overload list x 2
10-
verify.numberOfErrorsInCurrentFile(4);
9+
// Class declaration cannot implement overload list
10+
verify.numberOfErrorsInCurrentFile(2);
1111

1212
// Shouldn't change the number of errors
1313
edit.insert('return null;');
14-
verify.numberOfErrorsInCurrentFile(4);
14+
verify.numberOfErrorsInCurrentFile(2);
1515

0 commit comments

Comments
 (0)