Skip to content
ZOLO / TM114 Type · error

mixin result is incompatible with the decorated target

Compiler diagnostic TM114: mixin result is incompatible with the decorated target.

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.

See also

  • TM113 — mixin configuration arguments.
  • TM115 — explicit super(...) arguments.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en