aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/generic-fn-infer.rs
blob: 4398670f15e9a9256f932fc8d061616daf346f94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// -*- rust -*-

// Issue #45: infer type parameters in function applications

fn id[T](&T x) -> T {
  ret x;
}

fn main() {
  let int x = 42;
  let int y = id(x);
  check (x == y);
}