sorbet/sorbet

Missing definitions for `Proc#<<` and `Proc#>>`

Closed

#9,656 opened on Nov 17, 2025

 (2 comments) (0 reactions) (0 assignees)C++ (620 forks)github user discovery
buggood first issuerbi

Repository metrics

Stars
 (3,791 stars)
PR merge metrics
 (Avg merge 10d 5h) (43 merged PRs in 30d)

Description

Input

→ View on sorbet.run

# typed: true
extend T::Sig

sig {params(f: Proc, g: Proc).void}
def foo(f, g)
  f << g
  f >> g
end

Observed output

editor.rb:6: Method << does not exist on Proc https://srb.help/7003
     6 |  f << g
            ^^
  Got Proc originating from:
    editor.rb:5:
     5 |def foo(f, g)
                ^
  Did you mean <? Use -a to autocorrect
    editor.rb:6: Replace with <
     6 |  f << g
            ^^
    https://github.com/sorbet/sorbet/tree/master/rbi/core/module.rbi#L74: Defined here
    74 |  def <(other); end
          ^^^^^^^^^^^^

editor.rb:7: Method >> does not exist on Proc https://srb.help/7003
     7 |  f >> g
            ^^
  Got Proc originating from:
    editor.rb:5:
     5 |def foo(f, g)
                ^
  Did you mean >? Use -a to autocorrect
    editor.rb:7: Replace with >
     7 |  f >> g
            ^^
    https://github.com/sorbet/sorbet/tree/master/rbi/core/module.rbi#L188: Defined here
     188 |  def >(other); end
            ^^^^^^^^^^^^
Errors: 2

Expected behavior

Missing RBI definitions for methods added in Ruby 2.6

https://rubyreferences.github.io/rubychanges/2.6.html#proc-composition

https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/


Contributor guide