I have the following function
def fcn(lst)
if (lst.size == 0)
return [] of Int32
end
lc = lst.map{|a| a[1]}
end
When doing:
lst = [] of Int32
puts(fcn(lst))
I get:
Error in line 8: instantiating 'fcn(Array(Int32))'
in line 5: undefined method '[]' for Int32
It seems "if" is not taken into account. How can I resolve this error?