class Platform cue init(name as String) base.init _name = name get name from var as String def equals(other as Object?) as bool is override if other is this, return true if other inherits Platform return .name == other.name else return false def getHashCode as int is override return .name.getHashCode def toString as String is override return .name class Test def main is shared nonsorted = [Platform('Linux'), Platform('MS Windows'), Platform('Apple')] sorted = [Platform('Apple'), Platform('Linux'), Platform('MS Windows')] assert nonsorted <> sorted # sort with ref t = List(nonsorted) assert t == nonsorted and t <> sorted t.sort(do(a as Platform, b as Platform)) # .error. cannot yield yield 1 # .error. cannot yield t.sort(do(a as Platform, b as Platform)) return x # .error. cannot find "x" # TODO: argument type mismatch # TODO: explicit return type mismatch