aboutsummaryrefslogtreecommitdiff
path: root/tests/langerrors
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:11:59 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:11:59 +0330
commit19cdaa91b74da17a78809433ff7e6a2c084d8385 (patch)
tree619993ef12f3ce7f057843a01520f3079b6bacd5 /tests/langerrors
parentfndef: a second definition of a function in the same module is 'is defined tw... (diff)
fndef: a prototype after a definition in the same module keeps the definition (appendix b.2.4)
Diffstat (limited to 'tests/langerrors')
-rw-r--r--tests/langerrors/proto_after_def_mismatch.zc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/langerrors/proto_after_def_mismatch.zc b/tests/langerrors/proto_after_def_mismatch.zc
new file mode 100644
index 0000000..94a04e6
--- /dev/null
+++ b/tests/langerrors/proto_after_def_mismatch.zc
@@ -0,0 +1,4 @@
+// expect: f: doesn't match its earlier declaration
+int f(int a) { return a; }
+int f(int a, int b);
+fn main() { return f(1); }