diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index 15266d2d2a7..5d47d1616d7 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs @@ -1629,8 +1629,7 @@ impl TypeCheckAnalysis for ty::ImplSelfOrTrait { ctx.push_nodes_for_impl_trait(self); // Now lets analyze each impl trait item. - for (i, item) in impl_trait.items.iter().enumerate() { - let _node = ctx.items_node_stack[i]; + for item in impl_trait.items.iter() { item.type_check_analyze(handler, ctx)?; } diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.lock new file mode 100644 index 00000000000..a0991ddd91b --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.lock @@ -0,0 +1,8 @@ +[[package]] +name = "core" +source = "path+from-root-F62FA9D54ABC8F01" + +[[package]] +name = "mismatch_closing_delimiters" +source = "member" +dependencies = ["core"] diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.toml new file mode 100644 index 00000000000..084875b06eb --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/Forc.toml @@ -0,0 +1,9 @@ +[project] +authors = ["Fuel Labs "] +license = "Apache-2.0" +name = "mismatch_closing_delimiters" +entry = "main.sw" +implicit-std = false + +[dependencies] +core = { path = "../../../../../../sway-lib-core" } diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/src/main.sw new file mode 100644 index 00000000000..22272bdf326 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/src/main.sw @@ -0,0 +1,14 @@ +script; + +struct Struct{x:u} +impl Struct{ + fn w()->f{{(()}} + trait Supertrait{} + impl Supertrait for Struct{) +} + +fn s(b:B) where A:t{}fn n(){} + +fn main() -> u64 { + 0 +} diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/test.toml b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/test.toml new file mode 100644 index 00000000000..e3280310725 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_fail/mismatch_closing_delimiters/test.toml @@ -0,0 +1,4 @@ +category = "fail" + +# check: $()fn w()->f{{(()}} +# nextln: $()mismatched delimiters