import std::io; trait same { def same(&this, other: &T): bool; } struct pt { var x: i64; } def pt::same(&this, other: &pt): bool { return this.x == other.x; } type point = pt; type spot = point; def check(a: &T, b: &T): string { if const T is same { return a.same(b) ? "same" : "differ"; } return "unknown"; } def main(): void { val a: point = pt { 1 }; val b: point = pt { 1 }; val c: spot = pt { 2 }; println($"{check::(&a, &b)} {check::(&a, &b)} {check::(&c, &c)}"); }