Error codes

E0301: ambiguous overload

In a terminal: auk explain E0301 prints this page.

On this page

More than one overload fits this call equally well, so Auk can't choose one, or an overloaded function was used as a value, where there is no call to choose by.

Wrong#

auk
fn size<T>(xs: [T]): int = xs.len()
fn size(xs: [int]): int = 0
fn main() { print(size([1])) }

Fixed#

auk
fn size<T>(xs: [T]): int = xs.len()
fn zeros(xs: [int]): int = 0
fn main() { print(size([1])) }

Common causes#

  • A generic overload and a specific one that both fit: rename one of them.
  • Passing an overloaded function by name, xs.map(show): wrap it, xs.map(x => show(x)).

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