In Ruby 3.4, the following code returns different results depending on which parser is used:
# test.rb
class Foo
define_method "foo" \
"bar" do
end
end
p Foo.instance_method(:foobar).source_location
With ruby --parser=parse.y test.rb I get ["test.rb", 2]
With ruby --parser=prism test.rb I get ["test.rb", 3]
I'm using ruby 3.4.0preview2 (2024-10-07 master 32c733f57b) +PRISM [arm64-darwin23]