From a76fd9b5af153773273121c7aec2a9cbeed1dfb7 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 24 May 2026 18:18:23 +0200 Subject: Make diagnostics generic over passes, condensing different error handling Signed-off-by: Mel --- boot/tests/lower/shadowing_error.cskt | 4 ++-- boot/tests/lower/type_cycle_error.cskt | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'boot/tests/lower') diff --git a/boot/tests/lower/shadowing_error.cskt b/boot/tests/lower/shadowing_error.cskt index b22dddf..34eacc4 100644 --- a/boot/tests/lower/shadowing_error.cskt +++ b/boot/tests/lower/shadowing_error.cskt @@ -25,5 +25,5 @@ main = fun () { (declaration x (ref int) (initializer (expr 1))) ))) (emission_order 0 1 2 3 4 5 6 7) - (diagnostics - (error "name 'x' shadows an existing binding"))) + (lower_errors + (name-shadows x))) \ No newline at end of file diff --git a/boot/tests/lower/type_cycle_error.cskt b/boot/tests/lower/type_cycle_error.cskt index 29b791e..c6bfb6c 100644 --- a/boot/tests/lower/type_cycle_error.cskt +++ b/boot/tests/lower/type_cycle_error.cskt @@ -22,8 +22,5 @@ B = type { a A } (type 8 A structure (field b (ref B)) (depends_on 9)) (type 9 B structure (field a (ref A)) (depends_on 8))) (emission_order 0 1 2 3 4 5 6 7) - (diagnostics - (error "type cycle detected: - A (line 1) depends on B - B (line 2) depends on A -hint: break the cycle with a reference (use `&T` instead of `T`). :)"))) + (lower_errors + (type-cycle (chain A B)))) \ No newline at end of file -- cgit 1.4.1