rust/src/test/run-pass/auto-deref-fn.rs
Michael Sullivan 7340824cbc Fix autoderef of function calls when the function is not an lval.
As it turns out, the correct way to handle this is much simpler than what I
did originally.
Also add more tests.
2011-07-11 11:38:01 -07:00

13 lines
243 B
Rust

// xfail-stage0
fn add1(int i) -> int { ret i+1; }
fn main() {
auto f = @add1;
auto g = @f;
auto h = @@@add1;
assert(f(5) == 6);
assert(g(8) == 9);
assert(h(0x1badd00d) == 0x1badd00e);
assert((@add1)(42) == 43);
}