From 82f8b735f966be69f9892350fb0a719f3fc436f1 Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 16:51:03 +0330 Subject: as: the type after as is read greedily in both compilers; x as int * y is a syntax error (appendix b.2.12 settled, no compiler change) --- tests/conformance/9-appendix-b/b2_12_as_int_star.zc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/conformance/9-appendix-b') diff --git a/tests/conformance/9-appendix-b/b2_12_as_int_star.zc b/tests/conformance/9-appendix-b/b2_12_as_int_star.zc index fc12792..da54802 100644 --- a/tests/conformance/9-appendix-b/b2_12_as_int_star.zc +++ b/tests/conformance/9-appendix-b/b2_12_as_int_star.zc @@ -1,6 +1,6 @@ -// expect: 6/ -// spec appendix b.2.12: x as int * y should multiply +// expect error: expected ')', found 'y' +// spec 3.2.3 and appendix b.2.12: the type after as is read greedily, so x as int * y reads int* and then fails; write (x as int) * y include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } fn main() { int x = 2; int y = 3; pn(x as int * y); return 0; } -// zc0: skip +// zc0: error -- cgit v1.2.3