Another glitch in #824
It seems that RubyMine doesn't properly recognize instance allocation in
a non-static context (i.e. the class doing the instantiation is a
variable, not a constant) e.g.
class Foo
def initialize(*args)
puts "Foo.init: #{args.inspect}"
end
end
cls = Class.new(Foo)
cls.new('foo', 'bar') #=> Foo.init:
RubyMine highlights that last line as an error, claiming that there are
too many arguments.
cheers,
Charles
请先登录再写评论。
Hello Charles,
As far as Ruby is dynamic language it is rather hard to support all the possible variants of new instance allocations.
You can fill an issue on this problem in our bug tracker system, but I'm not sure it will be fixed somewhen.
There loads of dynamic trick and we don't have any chance to support all of them and now our main effort is to support Rails specific calls and smart completion for its arguments.
Thanks,
Oleg
Oleg,
That's ok, and usually rubymine is correct, which is very helpful, but
there isn't the option to suppress the inspection for the statement, so
I either need to disable the inspection entirely, or live with the IDE
telling me I have errors in my code.
Oleg Shpynov wrote:
Hello,
I've filled an issue: http://www.jetbrains.net/jira/browse/RUBY-3680
Feel free to vote and track progress on it.
Regards,
Oleg