diff --git a/ChangeLog b/ChangeLog index 46477aedbe..f7487a30b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jun 13 20:50:07 2016 Nobuyoshi Nakada + + * parse.y (reg_named_capture_assign_iter): remove named capture + conflict warnings. it is just annoying rather than useful. + [ruby-core:75416] [Bug #12359] + Mon Jun 13 20:04:00 2016 Kenta Murata * numeric.c (rb_int_digits, rb_fix_digits, rb_int_digits_bigbase): diff --git a/parse.y b/parse.y index 005e926ef0..362dea7721 100644 --- a/parse.y +++ b/parse.y @@ -10616,10 +10616,6 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end, return ST_CONTINUE; } var = intern_cstr(s, len, enc); - if (dvar_defined(var) || local_id(var)) { - rb_warning1("named capture conflicts a local variable - %"PRIsWARN, - rb_id2str(var)); - } node = newline_node(node_assign(assignable(var, 0), NEW_LIT(ID2SYM(var)))); succ = arg->succ_block; if (!succ) succ = NEW_BEGIN(0); diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 9f83598ceb..eca1744b96 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -869,9 +869,9 @@ x = __ENCODING__ def test_named_capture_conflict a = 1 - assert_warning(/named capture conflict/) {eval("a = 1; /(?)/ =~ ''")} + assert_warning('') {eval("a = 1; /(?)/ =~ ''")} a = "\u{3042}" - assert_warning(/#{a}/) {eval("#{a} = 1; /(?<#{a}>)/ =~ ''")} + assert_warning('') {eval("#{a} = 1; /(?<#{a}>)/ =~ ''")} end =begin