Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Aug 28, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

mame added 5 commits August 28, 2025 12:44
This change makes `RubyVM::AST.of` and `.node_id_for_backtrace_location`
return a parent node of NODE_SCOPE (such as NODE_DEFN) instead of the
NODE_SCOPE node itself.
(In future, we may remove NODE_SCOPE, which is a bit hacky AST node.)

This is preparation for [Feature #21543].
Previously, it was not possible to obtain a node of the callee's
`Thread::Backtrace::Location` for cases like "wrong number of
arguments" by using `RubyVM::AST.of`. This change allows that retrieval.

This is preparation for [Feature #21543].
…arguments" error

This is an experimental implementation for
https://bugs.ruby-lang.org/issues/21543.

```
test.rb:2:in 'Object#foo': wrong number of arguments (given 1, expected 2) (ArgumentError)

    caller: test.rb:6
    |   foo(1)
        ^^^
    callee: test.rb:2
    | def foo(x, y)
          ^^^
        from test.rb:6:in 'Object#bar'
        from test.rb:10:in 'Object#baz'
        from test.rb:13:in '<main>'
```

ruby/error_highlight@21e974e1c4
@pull pull bot locked and limited conversation to collaborators Aug 28, 2025
@pull pull bot added the ⤵️ pull label Aug 28, 2025
@pull pull bot merged commit b85b2b8 into turkdevops:master Aug 28, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant