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.
19 lines
714 B
Plaintext
19 lines
714 B
Plaintext
// A top-level VALUE constant name used in a type position is rejected. Without
|
|
// the fix the unknown-type pass added every `const_decl` name to its declared-
|
|
// type set, so a value const (`NotAType :: 123`) satisfied the check and the
|
|
// type resolver's unknown-name fallback then fabricated an empty struct — the
|
|
// program ran and printed `NotAType{}`. Now only consts whose value introduces a
|
|
// type (declarations / type-expression aliases) count as type names.
|
|
// Regression (issue 0068).
|
|
// Expected: a clean "unknown type 'NotAType'" error at the annotation; exit 1.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
NotAType :: 123;
|
|
|
|
main :: () -> i32 {
|
|
v: NotAType = ---;
|
|
print("value = {}\n", v);
|
|
return 0;
|
|
}
|