From 5a4f3885edafe289dce17ec8b53a8fc188b9e146 Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 15:53:37 +0330 Subject: capture_scan: restore panic after the dry scan, so a bad literal in a function's first statement is reported --- tests/langerrors/bad_char_first_statement.zc | 3 +++ tests/langerrors/bad_float_first_statement.zc | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/langerrors/bad_char_first_statement.zc create mode 100644 tests/langerrors/bad_float_first_statement.zc (limited to 'tests/langerrors') diff --git a/tests/langerrors/bad_char_first_statement.zc b/tests/langerrors/bad_char_first_statement.zc new file mode 100644 index 0000000..ca2ccfa --- /dev/null +++ b/tests/langerrors/bad_char_first_statement.zc @@ -0,0 +1,3 @@ +// expect: bad character literal +include rt; +fn main() { int a = 'ab'; rt.put_n(a); return 0; } diff --git a/tests/langerrors/bad_float_first_statement.zc b/tests/langerrors/bad_float_first_statement.zc new file mode 100644 index 0000000..2dcca38 --- /dev/null +++ b/tests/langerrors/bad_float_first_statement.zc @@ -0,0 +1,3 @@ +// expect: bad float +include rt; +fn main() { rt.put_n(1e); return 0; } -- cgit v1.2.3