Closed
Description
fn f(v: ~[int]) {
for v.each {|z| log(error, z); };
}
I used the old lambda syntax and got this error message:
/Users/TimChevalier/Scratch/f.rs:3:8: 3:34 error: mismatched types: expected `fn(&&int)` but found `fn()` (incorrect number of function parameters)
/Users/TimChevalier/Scratch/f.rs:3 for v.each {|z| log(error, z); };
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/TimChevalier/Scratch/f.rs:3:8: 3:34 error: mismatched types: expected `fn(&&int) -> bool` but found `fn() -> bool` (incorrect number of function parameters)
/Users/TimChevalier/Scratch/f.rs:3 for v.each {|z| log(error, z); };
^~~~~~~~~~~~~~~~~~~~~~~~~~
It took me a good 5 minutes to figure out what I was doing wrong there. Surely there could be a better error message for this.