Files
sx/examples/diagnostics/1168-diagnostics-generic-param-uninferrable.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
587 B
Plaintext

// A direct call to a generic fn whose arguments cannot bind a TYPE
// param diagnoses at the call site instead of monomorphizing with the
// param unbound. A `string` arg at a `[]$T` param is the canonical
// uninferrable shape (string deliberately does not bind `[]$T`); it
// used to stamp `.unresolved` through the body and PANIC the compiler
// at LLVM emission via the sentinel tripwire.
//
// Regression (issue 0126, diagnostic half).
#import "modules/std.sx";
first :: (xs: []$T) -> T {
return xs[0];
}
main :: () -> i32 {
print("{}\n", first("abc"));
return 0;
}