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:
@@ -1,5 +1,5 @@
|
||||
// a.sx authors `bump` adding 1. Imported first → first-wins winner. `from_a`'s
|
||||
// `v.bump()` resolves a.sx's own author (own == winner → existing UFCS path,
|
||||
// byte-for-byte unchanged).
|
||||
bump :: (x: s64) -> s64 { return x + 1; }
|
||||
bump :: ufcs (x: s64) -> s64 { return x + 1; }
|
||||
from_a_ufcs :: () -> s64 { v : s64 = 10; return v.bump(); }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// b.sx authors its OWN `bump` adding 100. `from_b`'s `v.bump()` must dispatch
|
||||
// b.sx's author (+100 → 110), not the first-wins winner from a.sx (+1).
|
||||
bump :: (x: s64) -> s64 { return x + 100; }
|
||||
bump :: ufcs (x: s64) -> s64 { return x + 100; }
|
||||
from_b_ufcs :: () -> s64 { v : s64 = 10; return v.bump(); }
|
||||
|
||||
Reference in New Issue
Block a user