Files
sx/examples/protocols/0407-protocols-protocol-typeparam-parse.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

21 lines
510 B
Plaintext

// Phase 1 (xx-via-Into mechanism): proves the new syntax parses + lowers
// without error. The parameterised protocol Into(Target: Type) and the
// matching `impl Into(Block) for Closure() -> void` declarations are
// registered but unused. Resolution (Phase 3) is what makes the impl
// reachable from `xx`.
#import "modules/std.sx";
MyTag :: struct { value: i64 = 0; }
impl Into(MyTag) for i64 {
convert :: (self: i64) -> MyTag {
.{ value = self }
}
}
main :: () -> i32 {
print("ok\n");
0
}