aboutsummaryrefslogtreecommitdiff
path: root/tests/langerrors/struct_const_runtime.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 09:33:46 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 09:33:46 +0000
commit04a92de49a40f4d3e58b39d3ad4549184afbeebc (patch)
treee37da74b5ccec23c6792a1c2eb230812ee42c307 /tests/langerrors/struct_const_runtime.zc
parentMerge std library docs (diff)
parentconstants inside structs, and typo suggestions for fields and static members (diff)
Merge branch 'worktree-agent-a96a10dc1489688ea' into ccr-0054c02e-dfdvnd
Diffstat (limited to 'tests/langerrors/struct_const_runtime.zc')
-rw-r--r--tests/langerrors/struct_const_runtime.zc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/langerrors/struct_const_runtime.zc b/tests/langerrors/struct_const_runtime.zc
new file mode 100644
index 0000000..b55626e
--- /dev/null
+++ b/tests/langerrors/struct_const_runtime.zc
@@ -0,0 +1,6 @@
+namespace;
+
+// expect: a struct constant must be a constant expression
+int f(int x) { return x; }
+struct Text { const MAX = f(3); int len; }
+fn main() { return 0; }