Skip to content

Net::IMAP::SearchResult#to_sequence_set raises ArgumentError for empty Net::IMAP::SearchResult #641

Description

@Quintasan

Hello,

I'm not sure if this is a bug (I think it is) but calling #to_sequence_set on empty Net::IMAP::SearchResult gives me ArgumentError:

strap(dev):011> s.imap.class
=> Net::IMAP
strap(dev):012> s.imap.uid_search(["ALL"])
=> []
strap(dev):013> s.imap.uid_search(["ALL"]).to_sequence_set
(strap):13:in '<main>': wrong number of arguments (given 0, expected 1+) (ArgumentError)

    caller: /home/quintasan/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/net-imap-0.6.3/lib/net/imap/search_result.rb:126
    |       def to_sequence_set; SequenceSet[*self] end
                                            ^^^^^^^
    callee: /home/quintasan/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/net-imap-0.6.3/lib/net/imap/sequence_set.rb:455
strap(dev):014> s.imap.uid_search(["ALL"]).class
=> Net::IMAP::SearchResult
strap(dev):015>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions