diff --git a/src/protocol/tests/parser_validation.rs b/src/protocol/tests/parser_validation.rs index e80f6a90615d914fc5882c72c00d9534292360c8..6097189b80e9c09c378adf4323dcd43b49e0ad33 100644 --- a/src/protocol/tests/parser_validation.rs +++ b/src/protocol/tests/parser_validation.rs @@ -619,10 +619,19 @@ fn test_correct_select_statement() { fn test_incorrect_select_statement() { Tester::new_single_source_expect_err( "outside sync", - "func f() -> u32 { select {} return 0; }" + "primitive f() { select {} }" ).error(|e| { e .assert_num(1) .assert_occurs_at(0, "select") .assert_msg_has(0, "inside sync blocks"); }); + + Tester::new_single_source_expect_ok( + "variable in previous block", + "primitive f() { + channel tx -> rx; + u32 a = 0; // this one will be shadowed + sync select { auto a = get(rx) -> {} } + }" + ); } \ No newline at end of file