Files
sx/examples/diagnostics/1111-diagnostics-nondollar-type-param-rejected.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

11 lines
516 B
Plaintext

// A value parameter declared `T: Type` (WITHOUT the `$` generic sigil) used in
// a type position is rejected with a hint to write `$T: Type`. Previously the
// type resolver silently fabricated a 0-field struct named `T`, so the call
// compiled and rendered as `T{}` at runtime with no diagnostic.
// Regression (issue 0064). Expected: one error per `T` use site; exit 1.
idwrap :: (T: Type, f: Closure() -> T) -> T { return f(); }
main :: () -> i32 {
return idwrap(i32, closure(() -> i32 { return 7; }));
}