Project

General

Profile

Bug #13012

irb fails to define a method with a reserved-word-ish keyword argument

Added by matsuda (Akira Matsuda) almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-12-07 trunk 57012) [x86_64-darwin14]
[ruby-core:78526]

Description

For example

def a(if:) end

is a valid ruby code but this doesn't work on irb.

This seems to be happening for all keywords that are listed in RubyLex::ENINDENT_CLAUSE


Related issues

Related to Ruby master - Bug #9975: irb で Hash を 1.9 記法で記述したときに、キーがキーワードだと syntax errorClosedkeiju (Keiju Ishitsuka)Actions
Is duplicate of Ruby master - Bug #12177: Using `if:` as symbol in hash with new hash syntax in irb console is not workingClosedkeiju (Keiju Ishitsuka)Actions

Also available in: Atom PDF