You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RPC methods are defined dynamically like (gen.rb:38):
define_methodmethod_namedo |*args, **kwargs|
Due to Ruby 2.2.1 bug, arguments are not received as they ware passed to method, when:
Method is defined using define_method.
Method parameter list contain both *args and **kwargs.
Method is contained in class that also contain method_missing method.
All of that requirements are fulfilled for RPC methods, which can result in situations when arguments are not received as they ware passed to those methods.
a1.m(1, 2.0, "trzy", a2) prints [nil, 1, [], {}], but should print [1, 2.0, "trzy", #<A:0x000000013f50d8>].
This bug is non-existent in Ruby 2.1.5 and fixed in Ruby 2.3.0dev. Hopefully the path will be backported to 2.2 when 2.3 is released.
The text was updated successfully, but these errors were encountered:
The bug only manifest itself when last argument passed to m is A's instance.
Which means that the correct output can be obtained by calling a1.m(1, 2.0, "trzy", a2, {}) instead of a1.m(1, 2.0, "trzy", a2).
RPC methods are defined dynamically like (gen.rb:38):
Due to Ruby 2.2.1 bug, arguments are not received as they ware passed to method, when:
define_method
.*args
and**kwargs
.method_missing
method.All of that requirements are fulfilled for RPC methods, which can result in situations when arguments are not received as they ware passed to those methods.
Ruby 2.2.1 argument passing bug
Minimal example:
a1.m(1, 2.0, "trzy", a2)
prints[nil, 1, [], {}]
, but should print[1, 2.0, "trzy", #<A:0x000000013f50d8>]
.This bug is non-existent in Ruby 2.1.5 and fixed in Ruby 2.3.0dev. Hopefully the path will be backported to 2.2 when 2.3 is released.
The text was updated successfully, but these errors were encountered: