rust/src/test/run-pass/block-arg-call-as.rs
Niko Matsakis aa5382bb13 split proto from fn_decl, as not all fn_decls know the proto.
this will address the (crashing) new test added.
2011-12-29 20:29:28 -08:00

23 lines
354 B
Rust

use std;
fn asSendfn( f : sendfn()->uint ) -> uint {
ret f();
}
fn asLambda( f : lambda()->uint ) -> uint {
ret f();
}
fn asBlock( f : block()->uint ) -> uint {
ret f();
}
fn main() {
let x = asSendfn({|| 22u});
assert(x == 22u);
let x = asLambda({|| 22u});
assert(x == 22u);
let x = asBlock({|| 22u});
assert(x == 22u);
}