From ecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Mon, 12 Oct 2026 08:46:23 +0330 Subject: a --- docs/history/15-o3/code/tests/langerrors/const_index.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/fixed_nolen.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/fixed_push.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/fixed_to_dyn.zc | 4 ++++ docs/history/15-o3/code/tests/langerrors/o3_addr.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/o3_asm.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/o3_let.zc | 2 ++ docs/history/15-o3/code/tests/langerrors/o3_param.zc | 3 +++ 8 files changed, 19 insertions(+) create mode 100644 docs/history/15-o3/code/tests/langerrors/const_index.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/fixed_nolen.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/fixed_push.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/fixed_to_dyn.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/o3_addr.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/o3_asm.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/o3_let.zc create mode 100644 docs/history/15-o3/code/tests/langerrors/o3_param.zc (limited to 'docs/history/15-o3/code/tests/langerrors') diff --git a/docs/history/15-o3/code/tests/langerrors/const_index.zc b/docs/history/15-o3/code/tests/langerrors/const_index.zc new file mode 100644 index 0000000..03e927b --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/const_index.zc @@ -0,0 +1,2 @@ +// expect: the index is out of range for this array +fn main() { [4]int a; a[4] = 1; return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/fixed_nolen.zc b/docs/history/15-o3/code/tests/langerrors/fixed_nolen.zc new file mode 100644 index 0000000..b79c31e --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/fixed_nolen.zc @@ -0,0 +1,2 @@ +// expect: a fixed array needs its length +fn main() { fixed []int f = new(fixed []int); free(d*f); return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/fixed_push.zc b/docs/history/15-o3/code/tests/langerrors/fixed_push.zc new file mode 100644 index 0000000..a19bcb4 --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/fixed_push.zc @@ -0,0 +1,2 @@ +// expect: a fixed array can't grow or shrink +fn main() { fixed []int f = new(fixed []int, 3); push(f, 1); free(d*f); return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/fixed_to_dyn.zc b/docs/history/15-o3/code/tests/langerrors/fixed_to_dyn.zc new file mode 100644 index 0000000..483f62f --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/fixed_to_dyn.zc @@ -0,0 +1,4 @@ +// expect: type error: argument: expected []int, got fixed []int +typecheck on; +int take([]int.m g) { return len(g); } +fn main() { fixed []int f = new(fixed []int, 3); take(f); free(d*f); return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/o3_addr.zc b/docs/history/15-o3/code/tests/langerrors/o3_addr.zc new file mode 100644 index 0000000..815253d --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/o3_addr.zc @@ -0,0 +1,2 @@ +// expect: an o3 variable has no address +fn main() { o3 int z = 2; *int q = &z; return *q; } diff --git a/docs/history/15-o3/code/tests/langerrors/o3_asm.zc b/docs/history/15-o3/code/tests/langerrors/o3_asm.zc new file mode 100644 index 0000000..c8afb44 --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/o3_asm.zc @@ -0,0 +1,2 @@ +// expect: asm can't reach an o3 variable +fn main() { o3 int zz = 2; asm { zz @ _ } return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/o3_let.zc b/docs/history/15-o3/code/tests/langerrors/o3_let.zc new file mode 100644 index 0000000..d2aff9a --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/o3_let.zc @@ -0,0 +1,2 @@ +// expect: o3 variables need a type +fn main() { o3 { let x = 1; x++; } return 0; } diff --git a/docs/history/15-o3/code/tests/langerrors/o3_param.zc b/docs/history/15-o3/code/tests/langerrors/o3_param.zc new file mode 100644 index 0000000..5694720 --- /dev/null +++ b/docs/history/15-o3/code/tests/langerrors/o3_param.zc @@ -0,0 +1,3 @@ +// expect: o3 parameters need a type +o3 int f(x) { return x; } +fn main() { return f(1); } -- cgit v1.2.3