summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2025-12-15 21:46:17 +0100
committerBenoit Daloze <eregontp@gmail.com>2025-12-30 16:02:39 +0100
commitc970d2941d56a862bb9bb3b808cb588c2982f436 (patch)
tree11d706a9fcf13c88baa6e0b182f394f0b678f385 /spec
parentcd66d15858a06406d1de854f3e9690d3557a9864 (diff)
[Bug #21784] Fix the Proc#source_location start_column for stabby lambdas
* Consistent with plain `blocks` and `for` blocks and methods where the source_location covers their entire definition. * Matches the documentation which mentions "where the definition starts/ends". * Partially reverts d357d50f0a74409446f4cccec78593373f5adf2f which was a workaround to be compatible with parse.y.
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/proc/source_location_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/proc/source_location_spec.rb b/spec/ruby/core/proc/source_location_spec.rb
index 69b4e2fd82..18f1ca274c 100644
--- a/spec/ruby/core/proc/source_location_spec.rb
+++ b/spec/ruby/core/proc/source_location_spec.rb
@@ -61,7 +61,7 @@ describe "Proc#source_location" do
ruby_version_is("4.0") do
proc { true }.source_location.should == [__FILE__, __LINE__, 11, __LINE__, 19]
Proc.new { true }.source_location.should == [__FILE__, __LINE__, 15, __LINE__, 23]
- -> { true }.source_location.should == [__FILE__, __LINE__, 8, __LINE__, 17]
+ -> { true }.source_location.should == [__FILE__, __LINE__, 6, __LINE__, 17]
end
end
@@ -98,7 +98,7 @@ describe "Proc#source_location" do
location.should == ["foo", 100]
end
ruby_version_is("4.0") do
- location.should == ["foo", 100, 2, 100, 5]
+ location.should == ["foo", 100, 0, 100, 5]
end
end
end