E4084#
The label is supplied twice when calling a function with labelled parameters.
错误示例:#
pub fn f(a~ : Int) -> Unit {
println("Hello, \{a}")
}
fn main {
f(a=0, a=1) // Error: The label a~ is supplied twice.
}
建议#
As there is only one labelled parameter in the function call, you can simply provide a single value.
fn main {
f(a=0)
}
When there are multiple labelled parameters in the function call, and you made a typo to make this error, then you can change the name of the label supplied to the correct one.
fn main {
f(a=0, b=1)
}