2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
// Issue #45: infer type parameters in function applications
|
|
|
|
|
2011-01-17 18:03:38 -06:00
|
|
|
fn id[T](&T x) -> T {
|
2010-06-23 23:03:09 -05:00
|
|
|
ret x;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let int x = 42;
|
|
|
|
let int y = id(x);
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (x == y);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|