Type inference in for / each blocks

Hello again,


I'd like to make the suggestion to improve type inference for rails models and variables in "each" blocks



@users = User.find(:all)
@ints = [1,2,3]

works:
@user[0].

doesnt work:
@users.each do |u|
    u.
end



 


doesnt work:
for u in @users
    u.
end

works:
for i in [1,2,3]
    i.
end

doesnt work:
for i in @ints
   i.
end

Cheers :-)

0

请先登录再写评论。