Actions
Bug #20063
closedInconsistent behavior with required vs optional parameters
Description
Using repeated anonymous parameters, gives different behavior with the parameters in the same order based on whether they are required or optional.
def example_with_optional(_a = 1, _a = 2)
_a
end
def example_with_required(_a, _a)
_a
end
p example_with_optional # 2
p example_with_required(1, 2) # 1
It is unexpected that these two methods would return differently given the parameters are in the same order, based on whether they are optional or required.
Actions
Like0
Like1Like0Like0