Why this fires¶
A mixin replaces the decorated callable's result, so its produced value must
remain assignable to the target's declared return type. The check is repeated
with the real method receiver type: self is not an any escape hatch.
@mixin
fn text_result() -> str { "not an int" }
@text_result
// ^ error[TM114]
fn value() -> int { 7 }The same diagnostic catches a method mixin whose body returns self.name
(str) while the decorated method promises int.
Fix it¶
Make every explicit and implicit mixin return compatible with the decorated target, or change the target's public return contract intentionally.