From b1d8cc25e5000c4481176145324a26111b572da6 Mon Sep 17 00:00:00 2001 From: nick evans Date: Sun, 15 Dec 2024 17:43:10 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Workaround=20https://bugs.ruby-l?= =?UTF-8?q?ang.org/issues/20956?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This looks like a bug in prism: ``` $ rbenv shell 3.4.0-rc1 $ ruby -e 'pp ([["foo"]] in [/\Afoo\b/i | [/\Afoo\z/i, *]])' false $ ruby --parser=parse.y -e 'pp ([["foo"]] in [/\Afoo\b/i | [/\Afoo\z/i, *]])' true ``` --- lib/net/imap.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/net/imap.rb b/lib/net/imap.rb index c40400b7..07e5a317 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -3253,6 +3253,10 @@ def search_args(keys, charset_arg = nil, return: nil, charset: nil) esearch = false in [_, Array[RETURN_WHOLE, _, *] | RETURN_START] raise ArgumentError, "conflicting return options" + in [_, Array[RETURN_WHOLE, _, *]] # workaround for https://bugs.ruby-lang.org/issues/20956 + raise ArgumentError, "conflicting return options" + in [_, RETURN_START] # workaround for https://bugs.ruby-lang.org/issues/20956 + raise ArgumentError, "conflicting return options" in [return_opts, keys] return_opts = convert_return_opts(return_opts) esearch = true