From: "byroot (Jean Boussier) via ruby-core" Date: 2026-12-03T07:52:44+00:00 Subject: [ruby-core:127812] [Ruby Bug#22709] The `source_location` line of "stabby lambdas" should be the line where `->` is Issue #22709 has been reported by byroot (Jean Boussier). ---------------------------------------- Bug #22709: The `source_location` line of "stabby lambdas" should be the line where `->` is https://bugs.ruby-lang.org/issues/22709 * Author: byroot (Jean Boussier) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- 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 ```ruby 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 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/