aboutsummaryrefslogtreecommitdiff
path: root/tests/langerrors
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:10:42 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:10:42 +0330
commita752292b54e22a8024b9d9162762edd2efa533b5 (patch)
treec19c48c792237538ae2a393d2af9e15fd2884c55 /tests/langerrors
parentunary: u*x, m*x, d*x are not recasts when the tag names a global variable either (diff)
fndef: a second definition of a function in the same module is 'is defined twice' (appendix b.2.3)
Diffstat (limited to 'tests/langerrors')
-rw-r--r--tests/langerrors/fn_defined_twice.zc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/langerrors/fn_defined_twice.zc b/tests/langerrors/fn_defined_twice.zc
new file mode 100644
index 0000000..7af57e8
--- /dev/null
+++ b/tests/langerrors/fn_defined_twice.zc
@@ -0,0 +1,4 @@
+// expect: f: is defined twice
+int f() { return 1; }
+int f() { return 2; }
+fn main() { return f(); }