rust/src/test/run-pass/generic-fn-infer.rs
2011-07-27 15:54:33 +02:00

9 lines
181 B
Rust

// -*- rust -*-
// Issue #45: infer type parameters in function applications
fn id[T](x: &T) -> T { ret x; }
fn main() { let x: int = 42; let y: int = id(x); assert (x == y); }