error named-arg
What it means#
In a call, positional arguments come first and then named arguments (greet("Ann", loud: true)); a positional argument after a named one is forbidden (§6.1). A named argument must also name an existing parameter and may not be given twice.
Example#
fn greet(name: str, loud: bool = false, tail: str = "") -> str => name
fn main() {
greet("Ann", loud: true, "!") // <- named-arg (positional after named)
}error
named-arg
How to fix#
fn greet(name: str, loud: bool = false, tail: str = "") -> str => name
fn main() {
greet("Ann", loud: true, tail: "!")
}Name the trailing arguments too, or reorder them so that all positional ones come first.