Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore related info in diagnostic deduplication #50309

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3944,7 +3944,7 @@ namespace ts {
diagnostics = nonFileDiagnostics;
}

insertSorted(diagnostics, diagnostic, compareDiagnostics);
insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
}

function getGlobalDiagnostics(): Diagnostic[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ tests/cases/conformance/jsx/file.tsx(20,23): error TS2783: 'b' is specified more
tests/cases/conformance/jsx/file.tsx(21,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/jsx/file.tsx(21,23): error TS2783: 'd' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/jsx/file.tsx(22,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/jsx/file.tsx(22,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/jsx/file.tsx(22,23): error TS2783: 'd' is specified more than once, so this usage will be overwritten.


!!! error TS2318: Cannot find global type 'CallableFunction'.
!!! error TS2318: Cannot find global type 'NewableFunction'.
==== tests/cases/conformance/jsx/file.tsx (8 errors) ====
==== tests/cases/conformance/jsx/file.tsx (7 errors) ====
import React = require('react');

interface Props {
Expand Down Expand Up @@ -53,9 +52,6 @@ tests/cases/conformance/jsx/file.tsx(22,23): error TS2783: 'd' is specified more
~~~~~
DanielRosenwasser marked this conversation as resolved.
Show resolved Hide resolved
!!! error TS2783: 'a' is specified more than once, so this usage will be overwritten.
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:29: This spread always overwrites this property.
~~~~~
!!! error TS2783: 'a' is specified more than once, so this usage will be overwritten.
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:40: This spread always overwrites this property.
~~~~~
!!! error TS2783: 'd' is specified more than once, so this usage will be overwritten.
!!! related TS2785 tests/cases/conformance/jsx/file.tsx:22:40: This spread always overwrites this property.
Expand Down
6 changes: 1 addition & 5 deletions tests/baselines/reference/objectSpreadNegative.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(28,36): error TS111
tests/cases/conformance/types/spread/objectSpreadNegative.ts(28,53): error TS1117: An object literal cannot have multiple properties with the same name.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(32,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(37,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(37,7): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(39,14): error TS2783: 'b' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(41,53): error TS2783: 'd' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/types/spread/objectSpreadNegative.ts(43,7): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
Expand All @@ -27,7 +26,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(69,9): error TS2339
tests/cases/conformance/types/spread/objectSpreadNegative.ts(74,11): error TS2339: Property 'a' does not exist on type '{}'.


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

/// private propagates
Expand Down Expand Up @@ -91,9 +90,6 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(74,11): error TS233
~~~~~~~
!!! error TS2783: 'b' is specified more than once, so this usage will be overwritten.
!!! related TS2785 tests/cases/conformance/types/spread/objectSpreadNegative.ts:37:16: This spread always overwrites this property.
~~~~~~~
!!! error TS2783: 'b' is specified more than once, so this usage will be overwritten.
!!! related TS2785 tests/cases/conformance/types/spread/objectSpreadNegative.ts:37:23: This spread always overwrites this property.
let combinedMid: { a: number, b: string, c: boolean } =
{ ...o3, b: 'ok', ...o4 }
~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
goTo.marker();

// Function with bodies can only merge with classes
// Class declaration cannot implement overload list x 2
verify.numberOfErrorsInCurrentFile(4);
// Class declaration cannot implement overload list
verify.numberOfErrorsInCurrentFile(2);

// Shouldn't change the number of errors
edit.insert('return null;');
verify.numberOfErrorsInCurrentFile(4);
verify.numberOfErrorsInCurrentFile(2);