76d6120e52
It wasn't possible to refer to the constructor for a class nested inside an item from the class's outer scope. Fixed.
15 lines
224 B
Rust
15 lines
224 B
Rust
fn main() {
|
|
|
|
class b {
|
|
let i: int;
|
|
fn do_stuff() -> int { ret 37; }
|
|
new(i:int) { self.i = i; }
|
|
}
|
|
|
|
// fn b(x:int) -> int { fail; }
|
|
|
|
let z = b(42);
|
|
assert(z.i == 42);
|
|
assert(z.do_stuff() == 37);
|
|
|
|
} |