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

9 lines
183 B
Rust
Raw Normal View History

fn test(f: fn@(uint) -> uint) -> uint {
ret f(22u);
}
fn main() {
2012-01-10 08:49:15 -06:00
let f = fn~(x: uint) -> uint { ret 4u; };
log(debug, test(f)); //~ ERROR expected `fn@(uint) -> uint`
}