summary refs log tree commit diff
path: root/src/test/run-pass/fun-call-variants.rs
blob: 2f28b7c419212301bfb2fe62add124a341dee30d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// -*- rust -*-
fn ho(f: fn@(int) -> int) -> int { let n: int = f(3); ret n; }

fn direct(x: int) -> int { ret x + 1; }

fn main() {
    let a: int = direct(3); // direct
    let b: int = ho(direct); // indirect unbound

    let c: int = ho(direct(_)); // indirect bound
    assert (a == b);
    assert (b == c);
}