Project

General

Profile

Actions

Bug #10987

closed

Warning "warning “regex literal in condition” issued, even condition is not constant

Added by rovf (Ronald Fischer) about 9 years ago. Updated about 9 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p598 (2014-11-13) [x86_64-cygwin]
[ruby-core:<unknown>]

Description

The following program emits the warning 'regex literal in condition':

#!/usr/bin/ruby
while gets
    print if /foo/../bar/
end

It seems that the parser does not recognize, that the "if" clause matches the regexp against $_

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

  • Description updated (diff)
  • Status changed from Open to Rejected

The implicit matching in a flip-flop operator is warned.

Actions

Also available in: Atom PDF

Like0
Like0