Actions
Bug #20084
closedBreaking change with Regexp.new on 3.3.0
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
Description
Regexp.new used to take up to 3 arguments, but now only 1..2 are allowed:
[1] pry(main)> Regexp.new 'abc', 'i', 'n'
ArgumentError: wrong number of arguments (given 3, expected 1..2)
from (pry):1:in `initialize'
On 3.2.2:
[1] pry(main)> Regexp.new 'abc', 'i', 'n'
=> /abc/in
Updated by hsbt (Hiroshi SHIBATA) 8 months ago
- Related to Bug #18797: Third argument to Regexp.new is a bit broken added
Updated by hsbt (Hiroshi SHIBATA) 8 months ago
- Status changed from Open to Closed
It's intentional changes. see https://bugs.ruby-lang.org/issues/18797
Updated by nobu (Nobuyoshi Nakada) 8 months ago
I think we needed to add it to Compatibility issues in NEWS.md.
Updated by paddor (Patrik Wenger) 8 months ago
hsbt (Hiroshi SHIBATA) wrote in #note-2:
It's intentional changes. see https://bugs.ruby-lang.org/issues/18797
Thanks.
nobu (Nobuyoshi Nakada) wrote in #note-3:
I think we needed to add it to Compatibility issues in NEWS.md.
Yeah that would be nice.
Actions
Like0
Like0Like0Like0Like0