Project

General

Profile

Actions

Bug #8151

closed

Duplicate character class warning

Added by tenderlovemaking (Aaron Patterson) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1]
Backport:
[ruby-core:53649]

Description

I get a duplicate character class warning, but I think it's a bug. Here is the example code:

def embed exp, depth
  return exp if depth == 0
  embed(/#{exp}/, depth - 1)
end

3.times { |i|
  puts "DEPTH #{i + 1}"
  embed(/[a-z\u{7b}-\u{7d}]/, i + 1)
}

At depth = 1, there is no warning, but greater than 1, I get a duplicate character class warning. I don't think the character class overlaps, so there should never be a warning.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0