Project

General

Profile

Actions

Feature #11605

closed

Ruby should raise on def(a='a', b) [optional param that can't be used]

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

Added by rosenfeld (Rodrigo Rosenfeld Rosas) about 10 years ago. Updated almost 4 years ago.

Status:
Rejected
Target version:
-
[ruby-core:71115]

Description

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?

Actions

Also available in: PDF Atom