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) --- .../conformance/3-expressions/cast_as_then_multiply_parenthesised.zc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/conformance/3-expressions/cast_as_then_multiply_parenthesised.zc (limited to 'tests/conformance/3-expressions') diff --git a/tests/conformance/3-expressions/cast_as_then_multiply_parenthesised.zc b/tests/conformance/3-expressions/cast_as_then_multiply_parenthesised.zc new file mode 100644 index 0000000..ab11217 --- /dev/null +++ b/tests/conformance/3-expressions/cast_as_then_multiply_parenthesised.zc @@ -0,0 +1,5 @@ +// expect: 6/ +// spec 3.2.3: (x as int) * y multiplies +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; } -- cgit v1.2.3