Files
sx/examples/diagnostics/1140-diagnostics-reserved-name-const-fn-decl.sx
agra 66bdc70bf1 test: group examples into per-category folders
Move examples/*.sx and their expected/ snapshots into per-category
subfolders (examples/<category>/...). Folder = leading filename token,
with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus
runner and LSP sweep now discover each category's expected/ dir, while
issues/ stays flat. Example 1058's repo-root-relative companion import
is made file-relative. Path strings embedded in 164 snapshots were
regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
2026-06-21 14:41:34 +03:00

20 lines
831 B
Plaintext

// A reserved/builtin type-name spelling is rejected as the NAME of a `::`
// declaration too — both a constant (`i2 :: 5`) and a function
// (`u8 :: (…) {…}`). A function name and a const name are binding sites just
// like `i2 := …`; previously the `::` decl forms slipped past the
// reserved-name check, so a bare reserved-name function compiled silently and
// became callable — bypassing the backtick rule that handwritten sx must use.
// The backtick escape (`` `i2 :: … ``, examples/0153) is the only way to spell
// these names; `#import c` extern decls remain exempt (examples/1220).
//
// Regression (issue 0089). Expected: one error per declaration, each caret on
// the declared name; exit 1.
#import "modules/std.sx";
i2 :: 5;
u8 :: (n: i64) -> i64 { return n + 7; }
main :: () -> i32 {
return 0;
}