From: merch-redmine@... Date: 2019-07-12T01:50:20+00:00 Subject: [ruby-core:93697] [Ruby master Bug#9623] warning: "named capture conflicts a local variable" does not allow loops with named captures Issue #9623 has been updated by jeremyevans0 (Jeremy Evans). Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN) Status changed from Open to Closed Fixed by commit:75a68057c712897bce6d787114ffa72504556756. ---------------------------------------- Bug #9623: warning: "named capture conflicts a local variable" does not allow loops with named captures https://bugs.ruby-lang.org/issues/9623#change-79315 * Author: drbrain (Eric Hodel) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0] * Backport: ---------------------------------------- Given the following example: args = [] remaining = 'a,b,c' begin /(?[^,]*),?(?.*)/ =~ remaining args << token end until remaining.empty? p args Gives a warning with -w: test.rb:6: warning: named capture conflicts a local variable - remaining I'm unsure if the warning is useful here. Reassigning in the loop through the named captures seems clearer than using the regexp globals. -- https://bugs.ruby-lang.org/ Unsubscribe: