From: ynnor@... Date: 2015-03-20T13:22:36+00:00 Subject: [ruby-core:68576] [Ruby trunk - Bug #10987] [Open] Warning "warning “regex literal in condition” issued, even condition is not constant Issue #10987 has been reported by Ronald Fischer. ---------------------------------------- Bug #10987: Warning "warning ���regex literal in condition��� issued, even condition is not constant https://bugs.ruby-lang.org/issues/10987 * Author: Ronald Fischer * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.0.0p598 (2014-11-13) [x86_64-cygwin] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- 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 $_ -- https://bugs.ruby-lang.org/