Project

General

Profile

Actions

Bug #18669

closed

Warning `flags ignored` is displayed for `Regexp.new(/regexp/)`

Added by koic (Koichi ITO) 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0dev (2022-03-30T14:08:13Z master 75efbb98af) [x86_64-darwin19]
[ruby-core:108121]

Description

I encountered an unexpected warning in Ruby 3.2.0dev.

Reproduction code

Regexp.new(/regexp/)

Expected Behavior (Ruby 3.1.1)

No warnings.

% ruby -vwe 'Regexp.new(/regexp/)'
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin19]

Actual Behavior (Ruby 3.2.0dev)

warning: flags ignored is displayed.

% ruby -vwe 'Regexp.new(/regexp/)'
ruby 3.2.0dev (2022-03-30T14:08:13Z master 75efbb98af) [x86_64-darwin19]
-e:1: warning: flags ignored

I encountered it in a RuboCop build error:
https://app.circleci.com/pipelines/github/rubocop/rubocop/5974/workflows/94732274-f302-497a-a6bc-ffbf036c4e0b/jobs/213494

Perhaps https://github.com/ruby/ruby/pull/5703 change is related.

Actions #1

Updated by mame (Yusuke Endoh) 3 months ago

  • Status changed from Open to Closed

Applied in changeset git|c499a4c28a62813752aeb894d68d92fcec850ac0.


re.c: stop a wrong warning of "flags ignored" on Regexp.new(//)

[Bug #18669]

Updated by mame (Yusuke Endoh) 3 months ago

Yes, it was my fault. Thank you for your report!

Updated by koic (Koichi ITO) 3 months ago

I confirmed the expected behavior in the edge Ruby. Thank you for the quick fixing!

Actions

Also available in: Atom PDF