Project

General

Profile

Actions

Bug #15647

closed

Disallow "in" as a keyword argument name

Added by localhostdotdev (localhost .dev) about 5 years ago. Updated about 5 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
[ruby-core:91723]

Description

"in" is a reserved keyword and thus can't be accessed directly anyway.

e.g. the following is a syntax error:

def m(in:); p in; end; m(in: 1)

And as usual, doing in = 1 doesn't work.

"in" could still be passed as a keyword argument if using some kind of catch-all, e.g. m(args), m(*args), etc.

Source: https://twitter.com/drbrain/status/1104152696339087361

Actions

Also available in: Atom PDF

Like0
Like0Like0