From acd622f25a8baffbf16c9620dfe6dd0b35644c64 Mon Sep 17 00:00:00 2001 From: Y Togami <62130798+togami2864@users.noreply.github.com> Date: Sat, 17 Dec 2022 21:01:09 +0900 Subject: [PATCH] fix(ts/analyzer): Prevent extra error from being reported from `report_error_for_conflicting_parents` (#410) --- .../stc_ts_file_analyzer/src/analyzer/convert/interface.rs | 3 +-- .../interfaceWithMultipleBaseTypes.ts.stats.rust-debug | 6 +++--- crates/stc_ts_type_checker/tests/tsc-stats.rust-debug | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/stc_ts_file_analyzer/src/analyzer/convert/interface.rs b/crates/stc_ts_file_analyzer/src/analyzer/convert/interface.rs index dee27ba802..08e6ebad8f 100644 --- a/crates/stc_ts_file_analyzer/src/analyzer/convert/interface.rs +++ b/crates/stc_ts_file_analyzer/src/analyzer/convert/interface.rs @@ -102,10 +102,9 @@ impl Analyzer<'_, '_> { ) { match &*err { ErrorKind::MissingFields { .. } => {} - ErrorKind::Errors { errors, .. } if errors.iter().all(|err| matches!(&**err, ErrorKind::MissingFields { .. })) => {} - + ErrorKind::ObjectAssignFailed { .. } => {} _ => self.storage.report(err.convert(|err| ErrorKind::InterfaceNotCompatible { span })), } } diff --git a/crates/stc_ts_type_checker/tests/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts.stats.rust-debug b/crates/stc_ts_type_checker/tests/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts.stats.rust-debug index 0e9a2e555d..e95590a1fb 100644 --- a/crates/stc_ts_type_checker/tests/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts.stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts.stats.rust-debug @@ -1,6 +1,6 @@ Stats { - required_error: 4, - matched_error: 2, - extra_error: 6, + required_error: 5, + matched_error: 1, + extra_error: 0, panic: 0, } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug b/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug index b00aef2b74..94c943d037 100644 --- a/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug @@ -1,6 +1,6 @@ Stats { - required_error: 4269, - matched_error: 5615, - extra_error: 767, + required_error: 4270, + matched_error: 5614, + extra_error: 761, panic: 74, } \ No newline at end of file