rust/src/test/run-pass/generic-fn-infer.rs

10 lines
187 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
// -*- rust -*-
// Issue #45: infer type parameters in function applications
fn id<T: copy>(x: T) -> T { ret x; }
2010-06-23 23:03:09 -05:00
fn main() { let x: int = 42; let y: int = id(x); assert (x == y); }