class A def blah pass class B def blah pass class C def blah pass class Program def main types = [A, B, C] for i, type in types.numbered # This works: type = types[i] type().blah # This failed at compile time: types[i]().blah for i in types.count types[i]().blah