rust/src/test/compile-fail/sendfn-is-not-a-lambda.rs

9 lines
189 B
Rust
Raw Normal View History

fn test(f: fn@(uint) -> uint) -> uint {
2012-08-01 19:30:05 -05:00
return f(22u);
}
fn main() {
2012-08-01 19:30:05 -05:00
let f = fn~(x: uint) -> uint { return 4u; };
log(debug, test(f)); //~ ERROR expected `fn@(uint) -> uint`
}