Why this fires¶
Arguments supplied to a mixin application must satisfy the configuration
contract declared by @mixin(...). Positional and named arguments follow the
same arity, name, and type rules as an ordinary function call.
@mixin(times: int)
fn repeated() -> int { super() * times }
@repeated("three")
// ^^^^^^^^^ error[TM113]: expected int
fn value() -> int { 7 }Missing required values, extra values, duplicate values, and unknown named
arguments also produce TM113. An optional marker supplies the default nil
when omitted:
@mixin(prefix: str, suffix: str?)
fn framed() -> str { prefix + super() + (suffix ?? "]") }
@framed(prefix: "[")
fn label() -> str { "ok" }A callable identifier in the marker slot supplies a typed callable default:
fn fallback() -> int { 1 }
@mixin(callback: fallback)
fn around() -> int { callback() + super() }
@around // `callback` defaults to `fallback`
fn value() -> int { 41 }Fix it¶
Match the declared types and names. Named arguments may be written in any order; omit only optional/defaulted entries.