f3b2296ee4
(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
25 lines
395 B
Rust
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
|
|
}
|