Skip to content

Ruby comprehensions: .inject(0) { } and .each_with_object([]) { } never fire (block opener must follow the method name directly) #9442

Backlog

Description

@squid-protocol

SOP-002-v1 gap-cell decoy suite (epic #8863), Ruby batch.

False negative. Ruby comprehensions requires the block opener ({ or do) immediately after the method name. A method that takes an argument before its block never fires, and each_with_object always takes a memo argument, so that branch cannot fire on authentic code. inject(0) { ... } / reduce(1) { ... } miss for the same reason.

total  = items.inject(0) { |sum, item| sum + item }                 # expected >= 1, actual 0
groups = items.each_with_object([]) { |item, acc| acc << item }     # expected >= 1, actual 0

Pinned by strict xfail in tests/decoys/test_decoy_ruby.py.

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions