e3a1c5c96a
This is necessary to calculate the correct offsets for field references. Simple cross-crate class tests (still with fields only) now pass.
17 lines
294 B
Rust
17 lines
294 B
Rust
class cat {
|
|
priv {
|
|
let mutable meows : uint;
|
|
}
|
|
|
|
let how_hungry : int;
|
|
|
|
new(in_x : uint, in_y : int) { meows = in_x; how_hungry = in_y; }
|
|
}
|
|
|
|
fn main() {
|
|
let nyan : cat = cat(52u, 99);
|
|
let kitty = cat(1000u, 2);
|
|
assert(nyan.how_hungry == 99);
|
|
assert(kitty.how_hungry == 2);
|
|
}
|