Project

General

Profile

Actions

Bug #18669

closed

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

Added by koic (Koichi ITO) almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
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

Also available in: Atom PDF

Like0
Like0Like0Like0