diff options
| author | 2026-10-14 08:30:01 +0000 | |
|---|---|---|
| committer | 2026-10-14 08:30:01 +0000 | |
| commit | d274751e89f75cc0f0e25c6e5e87ef91b64597ee (patch) | |
| tree | ef76f2cfe9d2a09f3fe5d27278cf775649bc162f /tests/langerrors | |
| parent | lsp: quick fixes for hints and bare library names; comment cleanup (diff) | |
zc: untyped local const, c precedence for && and ||, import fixes for every module
const name = value; inside a function declares a local constant that takes
the initializer's type. the let quick fix now writes a bare const.
the self-hosted compiler bound || tighter than &&, unlike zc0 and the
readme. no existing source mixed them without parentheses, so only new
code was affected.
missing-name diagnostics and their quick fixes now search every module:
rt, core, run, loaded files, and std, icon and actor scanned from source,
including static groups (std.Text.itoa). typos suggest module exports
(putc -> rt.put_c) and get a change-to fix.
Diffstat (limited to 'tests/langerrors')
| -rw-r--r-- | tests/langerrors/const_local_no_init.zc | 8 | ||||
| -rw-r--r-- | tests/langerrors/const_local_write.zc | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/langerrors/const_local_no_init.zc b/tests/langerrors/const_local_no_init.zc new file mode 100644 index 0000000..15832a1 --- /dev/null +++ b/tests/langerrors/const_local_no_init.zc @@ -0,0 +1,8 @@ +namespace; +include rt; + +// expect: a const needs an initializer +fn main() { + const k; + return 0; +} diff --git a/tests/langerrors/const_local_write.zc b/tests/langerrors/const_local_write.zc new file mode 100644 index 0000000..31220be --- /dev/null +++ b/tests/langerrors/const_local_write.zc @@ -0,0 +1,9 @@ +namespace; +include rt; + +// expect: const storage cannot be modified +fn main() { + const k = 5; + k = 6; + rt.put_n(k); +} |
