rust/src/test/run-pass/autobind.rs
Erick Tryzelaar a37e00ed1f Change the ivec type syntax to [T].
This preserves the old syntax for now.
2011-08-09 11:29:36 -07:00

9 lines
217 B
Rust

fn f[T](x: &[T]) -> T { ret x.(0); }
fn g(act: fn(&[int]) -> int ) -> int { ret act(~[1, 2, 3]); }
fn main() {
assert (g(f) == 1);
let f1: fn(&[str]) -> str = f;
assert (f1(~["x", "y", "z"]) == "x");
}