[ruby-core:71115] [CommonRuby - Feature #11605] [Open] Ruby should raise on def(a='a', b) [optional param that can't be used]

From: rr.rosas@...
Date: 2015-10-19 16:49:29 UTC
List: ruby-core #71115
Issue #11605 has been reported by Rodrigo Rosenfeld Rosas.

----------------------------------------
Feature #11605: Ruby should raise on def(a='a', b) [optional param that can't be used]
https://bugs.ruby-lang.org/issues/11605

* Author: Rodrigo Rosenfeld Rosas
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
Why doesn't Ruby complain when defining a method like this?

~~~
def a(opt='opt', required)
end
~~~

I believe it's impossible to call method 'a' passing only required, while sticking to the default value for 'opt', right? So, why should Ruby allow such definition?



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next