rust/src/test/run-pass/issue-2935.rs
Tim Chevalier f3b2296ee4 Auto-deref the base expr in trans_method_callee
(specifically in the method_trait case) -- if you wrote x.f()
and x has type @T for a trait T, x wasn't getting auto-deref'ed.

This was bad.

Closes #2935
2012-08-06 19:17:44 -07:00

25 lines
395 B
Rust

//type t = { a: int };
// type t = { a: bool };
type t = bool;
trait it {
fn f();
}
impl of it for t {
fn f() { }
}
fn main() {
// let x = ({a: 4i} as it);
// let y = @({a: 4i});
// let z = @({a: 4i} as it);
// let z = @({a: true} as it);
let z = @(true as it);
// x.f();
// y.f();
// (*z).f();
#error["ok so far..."];
z.f(); //segfault
}