Skip to content
ZOLO / TM113 Type · error

mixin application argument contract failure

Compiler diagnostic TM113: mixin application argument contract failure.

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.

See also

  • TE110 — ordinary callable argument-count mismatch.
  • TM114 — incompatible mixin result.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en