""" combinations: (list-of, array-of, set-of, array-list, enumerable) + (list-of, array-of, set-of, array-list, enumerable) """ class Test def main .basic .subclass1 .subclass2 .listPlusArray .augment def basic t1 = ['a', 'b'] t2 = ['c'] t3 = t1 + t2 assert t3 == ['a', 'b', 'c'] assert t3 is not (t1 + t2) assert t3 is not (t1 + t2) def subclass1 t1 = MyList() t1.add(1) t2 = [2, 3] t3 = t1 + t2 assert t3 inherits MyList # .warning. expression is always of type assert t3 == [1, 2, 3] def subclass2 t1 = [1, 2] t2 = MyList() t2.add(3) t3 = t1 + t2 assert t3 inherits List # .warning. expression is always of type assert not t3 inherits MyList assert t3 == [1, 2, 3] def listPlusArray pass /# t1 = [1, 2] t2 = @[3, 4] t3 = t1 + t2 assert t3 inherits List assert t3 == [1, 2, 3, 4] #/ def augment t = [1, 2] t += [3, 4] assert t == [1, 2, 3, 4] class MyList inherits List pass