I am trying to pass an argument to Proc0#call but Sorbet fails:
foo do |data|
# Do stuff
end
sig { params(block: T.proc.void).void }
def foo(&block)
x = { foo: :bar }
block.call(x)
end
When I run Sorbet, I see this error:
Too many arguments provided for method Proc0#call. Expected: 0, got: 1 https://srb.help/7004
How do I avoid this using strict mode?
Now I see it! The signature passes the param as
arg0
See: https://sorbet.org/docs/procs