Files

19 lines
285 B
Plaintext

trait Show {
fn show(self: Self) -> void;
}
struct Point { x: i64, y: i64 }
extend Show Point {
fn show(self: Point) -> void {
print_i64(self.x);
print_i64(self.y);
}
}
fn main() -> i64 {
let p = Point { x: 10, y: 20 };
p.show();
return 0;
}