[#68478] Looking for MRI projects for Ruby Google Summer of Code 2015 — Tony Arcieri <bascule@...>

Hi ruby-core,

10 messages 2015/03/10

[ruby-core:68576] [Ruby trunk - Bug #10987] [Open] Warning "warning “regex literal in condition” issued, even condition is not constant

From: ynnor@...
Date: 2015-03-20 13:22:36 UTC
List: ruby-core #68576
Issue #10987 has been reported by Ronald Fischer.

----------------------------------------
Bug #10987: Warning "warning =E2=80=9Cregex literal in condition=E2=80=9D i=
ssued, even condition is not constant
https://bugs.ruby-lang.org/issues/10987

* Author: Ronald Fischer
* Status: Open
* Priority: Normal
* Assignee:=20
* 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 t=
he regexp against $_




--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next