KCL: Improve error messages for var referenced in own definition (#7374)

Jon pointed out that my new error message wasn't showing up in some
cases, and it should store/restore the previous var being defined.
This commit is contained in:
Adam Chalmers
2025-06-04 23:48:15 -05:00
committed by GitHub
parent 33d5a9cdc1
commit 9136fb0d1b
10 changed files with 299 additions and 1 deletions

View File

@ -3525,3 +3525,24 @@ mod ascription_unknown_type {
super::execute(TEST_NAME, true).await
}
}
mod var_ref_in_own_def_decl {
const TEST_NAME: &str = "var_ref_in_own_def_decl";
/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}
/// Test that parsing and unparsing KCL produces the original KCL input.
#[tokio::test(flavor = "multi_thread")]
async fn unparse() {
super::unparse(TEST_NAME).await
}
/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, true).await
}
}