// `Self` nested inside a SLICE in a protocol-method param resolves // correctly: the conformance gate substitutes `Self → T` THROUGH the // `[]` wrapper (and the `*Self` receiver), so a correct `[]T` impl is // accepted and dispatched — not falsely rejected as `[]Self` ≠ `[]T`. // // Regression (issue 0178 adversarial review): the signature gate's // `Self`-substitution originally only reached the bare leaf and a // one-level pointer/optional wrapper, so `[]Self` resolved to a real // slice named `[]Self` and a correct `[]T` impl was WRONGLY flagged. #import "modules/std.sx"; P :: protocol { // `*Self` receiver + `[]Self` slice param + `Self` value param. total :: (self: *Self, xs: []Self, extra: Self) -> i64; } T :: struct { n: i64 = 0; } impl P for T { total :: (self: *T, xs: []T, extra: T) -> i64 { sum := self.n + extra.n; for xs (x) { sum = sum + x.n; } return sum; } } main :: () { t := T.{ n = 10 }; p : P = t; arr : [3]T = .{ T.{ n = 1 }, T.{ n = 2 }, T.{ n = 3 } }; // 10 (self) + 1+2+3 (slice) + 100 (extra) = 116 print("{}\n", p.total(arr[..], T.{ n = 100 })); }