Actions
Bug #22709
openThe `source_location` line of "stabby lambdas" should be the line where `->` is
Bug #22709:
The `source_location` line of "stabby lambdas" should be the line where `->` is
Description
Creating a new issue because [Bug #21784] was about columns which are still being discussed, here it's about lines, already available on all rubies.
Reproduction¶
block = ->(
a = 1,
b = "2" + 3
) do # line 4 is here
:here
end
p block.source_location.last # => 4
block.call # TypeError /tmp/r.rb:3
I would expect source_location.last to return 1 (the line of ->).
Proposed patch: https://github.com/ruby/ruby/pull/20435
Updated by byroot (Jean Boussier) about 4 hours ago
- Related to Bug #21784: Proc#source_location start column seems strange for -> {} added
Actions