You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingModule.new{refineStringdodefto_procproc{ |it| it.sendself}enddefrefine_method"X#refine_method"endend}deffunc &blockendp"upcase".refine_method# => "X#refine_method"p"upcase".to_proc.call"homu"# => "HOMU"# Error: wrong argument type X (expected Proc) (TypeError)func &"upcase"
The final line should work, but raises. We don't handle this because the to_proc call is happening inside CallNode logic, with the string being passed as the block operand. We should move the to_proc call outside of the invocation so it can cache and inline and all.
The text was updated successfully, but these errors were encountered:
See https://bugs.ruby-lang.org/issues/14223
The final line should work, but raises. We don't handle this because the
to_proc
call is happening inside CallNode logic, with the string being passed as the block operand. We should move theto_proc
call outside of the invocation so it can cache and inline and all.The text was updated successfully, but these errors were encountered: