Skip to content

Fix prism_spot_def_for_name for singletons#68

Merged
jhawthorn merged 1 commit intoruby:masterfrom
jhawthorn:fix_def_operator_join
Nov 19, 2025
Merged

Fix prism_spot_def_for_name for singletons#68
jhawthorn merged 1 commit intoruby:masterfrom
jhawthorn:fix_def_operator_join

Conversation

@jhawthorn
Copy link
Member

Previously calling a singleton method with invalid arguments would give:

Error: test_singleton_method_multiple_missing_keywords(ErrorHighlightTest): RuntimeError: Incompatible locations
/Users/jhawthorn/.rubies/ruby-dev/lib/ruby/4.0.0+0/prism/parse_result.rb:505:in 'Prism::Location#join'
/Users/jhawthorn/src/error_highlight/lib/error_highlight/base.rb:916:in 'ErrorHighlight::Spotter#prism_spot_def_for_name'
/Users/jhawthorn/src/error_highlight/lib/error_highlight/base.rb:295:in 'ErrorHighlight::Spotter#spot'
/Users/jhawthorn/src/error_highlight/lib/error_highlight/base.rb:68:in 'ErrorHighlight.spot'

This is because join wants the operator to come before the location

Previously calling a singleton method with invalid arguments would give:

    RuntimeError: Incompatible locations

This is because `join` wants the operator to come before the location
@jhawthorn jhawthorn force-pushed the fix_def_operator_join branch from dbd8c2c to 4492055 Compare November 19, 2025 22:14
@jhawthorn jhawthorn merged commit 19ef9d4 into ruby:master Nov 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant