From: matthew@... Date: 2018-03-17T00:22:47+00:00 Subject: [ruby-core:86165] [Ruby trunk Bug#14611] Exotic method parameters bug Issue #14611 has been updated by phluid61 (Matthew Kerwin). Hanmac (Hans Mackowiak) wrote: > @phluid61 not so fast, ruby allows duplicate "_" as parameters so you can say that you don't want them and ruby should just ignore them > so you don't get a SyntaxError about duplicated argument name like your change did > > That has nothing to do with rubocop ... really? When did that happen? I had a look in syntax.rdoc and other places but didn't see any mention of it. ---------------------------------------- Bug #14611: Exotic method parameters bug https://bugs.ruby-lang.org/issues/14611#change-71048 * Author: bogdan (Bogdan Gusiev) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.4.2 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Consider the following code: ~~~ ruby def test(_, x, *_) x end test(1,2,3) # => nil ~~~ By some reason second parameter is nil when the rest of parameters declared as not used. -- https://bugs.ruby-lang.org/ Unsubscribe: