Project

General

Profile

Actions

Bug #13336

closed

Default Parameters don't work

Added by herbert.bonaffini@gmail.com (Herbert Bonaffini) about 7 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:80252]

Description

def funny(a = true, b: nil)
  p a
end

funny([1,2,3]) # => [1,2,3]

funny({k:1}) # => in `funny': unknown keyword: k (ArgumentError)

Files

hello_bug.rb (132 Bytes) hello_bug.rb herbert.bonaffini@gmail.com (Herbert Bonaffini), 03/20/2017 05:31 PM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #14183: "Real" keyword argumentClosedActions
Is duplicate of Ruby master - Bug #12717: Optional argument treated as kwargClosedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0