lang: opt-in UFCS — ufcs-marked fns + alias dot-dispatch, generic binding via receiver; one binding builder for plan-side generic returns

This commit is contained in:
agra
2026-06-11 17:04:51 +03:00
parent 84e0fb0752
commit a47ea1416e
27 changed files with 316 additions and 137 deletions

View File

@@ -10,9 +10,9 @@
Counter :: struct { n: s32; }
// FREE functions (defined outside the struct), pointer first param.
bump :: (c: *Counter) -> s32 { c.n += 1; return c.n; }
bump :: ufcs (c: *Counter) -> s32 { c.n += 1; return c.n; }
// reached ONLY via UFCS — must still be emitted.
reset :: (c: *Counter) { c.n = 0; }
reset :: ufcs (c: *Counter) { c.n = 0; }
main :: () -> s32 {
c := Counter.{ n = 10 };