From 1424caca1f7c5553f430ac77fa6b2df6edd1349a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 23 Mar 2023 19:12:49 +0900 Subject: [PATCH] fix: Make evaluation order not flaky (#850) **Related issue:** - https://github.com/swc-project/swc/pull/7133. --- Cargo.lock | 34 +++++++++---------- crates/stc_ts_builtin_macro/src/lib.rs | 2 +- crates/stc_ts_module_loader/Cargo.toml | 2 +- crates/stc_ts_ordering/Cargo.toml | 2 +- crates/stc_ts_type_checker/Cargo.toml | 2 +- ...sibleWithinNestedSubclass1.error-diff.json | 5 +-- ...ibleWithinNestedSubclass1.stats.rust-debug | 2 +- ...tyAccessibleWithinSubclass.error-diff.json | 4 +-- .../tests/tsc-stats.rust-debug | 2 +- 9 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7e05d5743..7b0d3adf4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,9 +88,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "ast_node" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf94863c5fdfee166d0907c44e5fee970123b2b7307046d35d1e671aa93afbba" +checksum = "70151a5226578411132d798aa248df45b30aa34aea2e580628870b4d87be717b" dependencies = [ "darling", "pmutil", @@ -603,9 +603,9 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c" +checksum = "1d449976075322384507443937df2f1d5577afbf4282f12a5a66ef29fa3e6307" dependencies = [ "pmutil", "proc-macro2", @@ -1402,9 +1402,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", @@ -2676,9 +2676,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.29.37" +version = "0.29.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5005cd73617e18592faa31298225b26f1c407b84a681d67efb735c3d3458e101" +checksum = "cb4fd4ec5ae15aff4e7a89bf02c220550bfa9716bfbed07d5632b655bdf87753" dependencies = [ "ahash 0.7.6", "ast_node", @@ -2884,13 +2884,13 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.17.16" +version = "0.17.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13830b02764bf532d347118283393fe6f2b6b5a93c6948af443d2891958705f9" +checksum = "be559d636a8d0ada4e26670ee15e82c6220386251d4f6a5b4065bfa3b1fd5c56" dependencies = [ - "ahash 0.7.6", "indexmap", "petgraph", + "rustc-hash", "swc_common", ] @@ -2909,9 +2909,9 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4be988307882648d9bc7c71a6a73322b7520ef0211e920489a98f8391d8caa2" +checksum = "3e582c3e3c2269238524923781df5be49e011dbe29cf7683a2215d600a562ea6" dependencies = [ "pmutil", "proc-macro2", @@ -2931,9 +2931,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470a1963cf182fdcbbac46e3a7fd2caf7329da0e568d3668202da9501c880e16" +checksum = "d1d5999f23421c8e21a0f2bc53a0b9e8244f3b421de89471561af2fbe40b9cca" dependencies = [ "either", "swc_visit_macros", @@ -2941,9 +2941,9 @@ dependencies = [ [[package]] name = "swc_visit_macros" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6098b717cfd4c85f5cddec734af191dbce461c39975ed567c32ac6d0c6d61a6d" +checksum = "ebeed7eb0f545f48ad30f5aab314e5208b735bcea1d1464f26e20f06db904989" dependencies = [ "Inflector", "pmutil", diff --git a/crates/stc_ts_builtin_macro/src/lib.rs b/crates/stc_ts_builtin_macro/src/lib.rs index 9f9f453da5..f931ce8dad 100644 --- a/crates/stc_ts_builtin_macro/src/lib.rs +++ b/crates/stc_ts_builtin_macro/src/lib.rs @@ -245,7 +245,7 @@ pub fn builtin(_: proc_macro::TokenStream) -> proc_macro::TokenStream { } )); - print("builtin", tokens) + print("builtin", tokens.into()) }) } diff --git a/crates/stc_ts_module_loader/Cargo.toml b/crates/stc_ts_module_loader/Cargo.toml index 4c40df09fb..46a9296dbe 100644 --- a/crates/stc_ts_module_loader/Cargo.toml +++ b/crates/stc_ts_module_loader/Cargo.toml @@ -32,5 +32,5 @@ swc_ecma_ast = "0.100.2" swc_ecma_loader = "0.41.39" swc_ecma_parser = "0.130.5" swc_ecma_visit = "0.86.2" -swc_fast_graph = "0.17.16" +swc_fast_graph = "0.17.41" tracing = "0.1.37" diff --git a/crates/stc_ts_ordering/Cargo.toml b/crates/stc_ts_ordering/Cargo.toml index 35c10b3093..de8c843b57 100644 --- a/crates/stc_ts_ordering/Cargo.toml +++ b/crates/stc_ts_ordering/Cargo.toml @@ -22,7 +22,7 @@ stc_ts_types = {path = "../stc_ts_types"} stc_ts_utils = {path = "../stc_ts_utils"} swc_atoms = "0.4.39" swc_common = "0.29.37" -swc_fast_graph = "0.17.16" +swc_fast_graph = "0.17.41" swc_graph_analyzer = "0.18.16" tracing = "0.1.37" diff --git a/crates/stc_ts_type_checker/Cargo.toml b/crates/stc_ts_type_checker/Cargo.toml index 7e329e2b94..421bb485cf 100644 --- a/crates/stc_ts_type_checker/Cargo.toml +++ b/crates/stc_ts_type_checker/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_parser = "0.130.5" swc_ecma_transforms = "0.212.14" swc_ecma_transforms_base = "0.122.11" swc_ecma_visit = "0.86.2" -swc_fast_graph = "0.17.16" +swc_fast_graph = "0.17.41" tracing = {version = "0.1.37", features = ["release_max_level_trace"]} [dev-dependencies] diff --git a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.error-diff.json b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.error-diff.json index 3e5ef34d15..b70c6f2eb5 100644 --- a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.error-diff.json +++ b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.error-diff.json @@ -31,11 +31,12 @@ ] }, "extra_errors": { - "TS2304": 1 + "TS2304": 2 }, "extra_error_lines": { "TS2304": [ - 62 + 62, + 83 ] } } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.stats.rust-debug b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.stats.rust-debug index b9ce848133..5aa4039903 100644 --- a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass1.stats.rust-debug @@ -1,6 +1,6 @@ Stats { required_error: 21, matched_error: 0, - extra_error: 1, + extra_error: 2, panic: 0, } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedStaticClassPropertyAccessibleWithinSubclass.error-diff.json b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedStaticClassPropertyAccessibleWithinSubclass.error-diff.json index 8ab9df4e67..058444e175 100644 --- a/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedStaticClassPropertyAccessibleWithinSubclass.error-diff.json +++ b/crates/stc_ts_type_checker/tests/conformance/classes/members/accessibility/protectedStaticClassPropertyAccessibleWithinSubclass.error-diff.json @@ -22,9 +22,9 @@ 6, 7, 23, - 25, 29, - 33 + 33, + 34 ] } } \ 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 fafb09b92f..e82ae961ac 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: 3804, matched_error: 6299, - extra_error: 843, + extra_error: 844, panic: 107, } \ No newline at end of file