class Test def main is shared Test().run def run # assert List(.numbers) == [1, 2, 3] t = List(.numbers(0)) assert t == [1, 2, 3] t = List(.numbers(1)) assert t == [1] def numbers(x as int) as IEnumerable yield 1 if x > 0 yield break yield 2 yield 3