rust/src/test/run-pass/class-dtor.rs
Tim Chevalier 5428a22b95 First cut at dtors for classes
Classes with dtors should compile now. Haven't yet tested
whether they actually run correctly.

Beginnings of support for #2295, though that won't be done until
there's more test cases and resources are removed.
2012-05-14 14:26:10 -07:00

12 lines
190 B
Rust

class cat {
let done : native fn(uint);
let meows : uint;
new(done: native fn(uint)) {
self.meows = 0u;
self.done = done;
}
drop { self.done(self.meows); }
}
fn main() {}