# Numeric For broken ticket:158 class NumericFor def main #n = [5,6] n = 5 stuff = for i in n get i #trace stuff assert stuff.typeOf is List assert stuff == [0, 1, 2, 3, 4] # this worked originally stuffI = for i in 1:n get .thingI(i) #trace stuffI assert stuffI.typeOf is List assert stuffI == [1, 4, 9, 16] # these didn't compile stuffO = for i in 1:n get .thing(i) #trace stuffO assert stuffO.typeOf is List assert stuffO == [1, 4, 9, 16] stuffS = for i in 1:n get .thingS(i) #trace stuffS assert stuffS.typeOf is List assert stuffS == ['1', '4', '9', '16'] stuffX = for i in 1:n get .thingX("[i]") #trace stuffX assert stuffX.typeOf is List assert stuffX == [r'-1-', r'-2-', r'-3-', r'-4-'] b = for i in 3 : 6 where i>=4 get .thingI(i) assert b.typeOf is List assert b == [16, 25] bO = for i in 3 : 6 where i>=4 get .thing(i) assert bO.typeOf is List assert bO == [16, 25] bS = for i in 3 : 6 where i>=4 get .thingS(i) assert bS.typeOf is List assert bS == ['16', '25'] bS = for i in 3 : 6 where i>=4 get (i*i).toString assert bS.typeOf is List assert bS == ['16', '25'] bX = for i in 3 : 6 where i>=4 get .thingX("[i]") assert bX.typeOf is List assert bX == ['-4-', '-5-'] def thingI(i as int) as int is shared return i*i def thing(i as int) as Object is shared return i*i def thingS(i as int) as String is shared return '[i*i]' def thingX(i as String) as String is shared return '-[i]-'