Why this fires¶
A mixin that references self is a method mixin. Applying it to a free
function would leave self without a receiver.
@mixin
fn named() -> str { self.name }
@named
fn value() -> str { "value" }
// ^ error[TM112]Fix it¶
Apply the mixin to an impl method, or remove the receiver dependency and
write the mixin only in terms of super(...) and its configuration values.
See also¶
TM114— the concretely typed mixin result is incompatible.docs/08-decorators.md— method mixins.