-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system
Milestone
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.
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system