E1017: positional call is ambiguous

View source

A positional call is allowed only when the arguments cannot be confused.

A positional call is allowed only when the arguments cannot be confused. If a verb has two parameters with the same role and the same type, swapping the arguments would still compile and silently change the result. The compiler rejects every positional call to such a verb, whatever the arguments are. The error points at the call.

Example

actus
verb scale(abs value: Int, abs factor: Int) -> Int {
    return value * factor;
}

verb main() {
    erg a: Int = 2;
    erg b: Int = 3;
    println(int: scale(a, b));
}

Fix

Name the arguments, which also shows their roles.

actus
verb scale(abs value: Int, abs factor: Int) -> Int {
    return value * factor;
}

verb main() {
    erg a: Int = 2;
    erg b: Int = 3;
    println(int: scale(value: abs a, factor: abs b));
}

Run actus explain E1017 in your terminal to read this entry offline. Browse Ownership & types or all error codes.