aboutsummaryrefslogtreecommitdiff
path: root/tests/typeerrors
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 09:39:39 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 09:39:39 +0000
commit0ed3f650e50bc6fa7712e1b3e650ec9bc678ac91 (patch)
treea34cc20ef06d80caf58a430a7f5b0b60494bbe35 /tests/typeerrors
parenttodo: tick struct constants and member typos; add follow-ups and the spec work (diff)
parentadd c-style typedef and a built-in string alias (diff)
Merge branch 'worktree-agent-a3354164c07827b2e' into ccr-0054c02e-dfdvnd
Diffstat (limited to 'tests/typeerrors')
-rw-r--r--tests/typeerrors/typedef_mismatch.zc6
-rw-r--r--tests/typeerrors/typedef_pointer.zc7
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/typeerrors/typedef_mismatch.zc b/tests/typeerrors/typedef_mismatch.zc
new file mode 100644
index 0000000..26453dd
--- /dev/null
+++ b/tests/typeerrors/typedef_mismatch.zc
@@ -0,0 +1,6 @@
+namespace;
+
+// expect: type error: initializer: expected int, got char*
+typecheck on;
+typedef int count;
+fn main() { count c = "text"; return 0; }
diff --git a/tests/typeerrors/typedef_pointer.zc b/tests/typeerrors/typedef_pointer.zc
new file mode 100644
index 0000000..5dbbb17
--- /dev/null
+++ b/tests/typeerrors/typedef_pointer.zc
@@ -0,0 +1,7 @@
+namespace;
+
+// expect: type error: initializer: expected node*, got int*
+typecheck on;
+struct node { int v; };
+typedef node* link;
+fn main() { int n = 0; link p = &n; return 0; }