Error codes

E0108: clauses disagree on a parameter type

In a terminal: auk explain E0108 prints this page.

On this page

The clauses of one function are tried top to bottom, so each parameter must have the same type in every clause. Here one clause declares a parameter with a different type than an earlier one.

Wrong#

auk
fn label(0, s: str): str = "zero"
fn label(n: int, s: int): str = "many"

Fixed#

auk
fn label(0, s: str): str = "zero"
fn label(n: int, s: str): str = "many {s}"

Common causes#

  • A typo in one clause's annotation.
  • Two different functions that happen to share a name: give them different names, or put the differing type first (overloads differ by their first parameter's type).

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page