[#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:68583] [Ruby trunk - Bug #10987] [Rejected] Warning "warning “regex literal in condition” issued, even condition is not constant

From: nobu@...
Date: 2015-03-20 23:52:24 UTC
List: ruby-core #68583
Issue #10987 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Rejected

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

----------------------------------------
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#change-51893

* Author: Ronald Fischer
* Status: Rejected
* 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':

~~~ruby
#!/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