Closed
Description
struct Foo {
foo: int,
}
struct Bar {
bar: int,
}
impl Bar {
fn make_foo (&self, i: int) -> ~Foo {
return ~Foo { nonexistent: self, foo: i };
}
}
fn main () {
let bar = Bar { bar: 1 };
let foo = bar.make_foo(2);
io::println(fmt!("%d", foo.foo));
}
produces
test2.rs:11:22: 11:39 error: structure has no field named `nonexistent`
test2.rs:11 return ~Foo { nonexistent: self, foo: i };
^~~~~~~~~~~~~~~~~
error: internal compiler error: no type for node 23: expr self (id=23) in fcx 7f5d0c438ce0