LYR-SEM0085
two functions of one name taking the same number of arguments
Two functions or methods of one name in one scope can take the same number of arguments, counting the ranges their defaults allow.
Explanation
Overloads are told apart by how many arguments a call passes, never by the arguments' types. Two of one name whose counts overlap could not be chosen between, so the pair is refused at the declaration rather than at a call.
Give the two distinct names, or make their argument counts disjoint.
Wrong
fn size(n: int): int { return n; }
fn size(s: string): int { return s.length(); }
fn main(): void {
}
Right
fn size(n: int): int { return n; }
fn sizeOf(s: string): int { return s.length(); }
fn main(): void {
let _ = size(3) + sizeOf("abc");
}