rust/src/test/run-pass/fun-indirect-call.rs

12 lines
142 B
Rust
Raw Normal View History

2010-06-23 21:03:09 -07:00
// -*- rust -*-
2012-08-01 17:30:05 -07:00
fn f() -> int { return 42; }
fn main() {
let g: extern fn() -> int = f;
let i: int = g();
assert (i == 42);
}