Project

General

Profile

Actions

Bug #20974

open

Required and optional anonymous parameter show differently in Proc#parameters

Added by alanwu (Alan Wu) 1 day ago. Updated 1 day ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:120350]

Description

The following has had the same output since Ruby 1.9, when Proc#parameters was introduced:

p(proc   { |(_a)| }.parameters) # => [[:opt, nil]]
p(lambda { |(_a)| }.parameters) # => [[:req]]

I think they should be [[:opt]] and [[:req]] or [[:opt, nil]] and [[:req, nil]]. I prefer the nil-free option since that feels more anonymous.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #20955: Subtle differences with Proc#parameters for anonymous parametersClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0