File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -700,6 +700,9 @@ def prism_spot_call_for_name
700
700
# foo 42
701
701
# ^^
702
702
def prism_spot_call_for_args
703
+ # Disallow highlighting arguments if there are no arguments.
704
+ return if @node . arguments . nil?
705
+
703
706
# Explicitly turn off foo.() syntax because error_highlight expects this
704
707
# to not work.
705
708
return nil if @node . name == :call && @node . message_loc . nil?
Original file line number Diff line number Diff line change @@ -197,6 +197,15 @@ def test_CALL_arg_6
197
197
end
198
198
end
199
199
200
+ def test_CALL_arg_7
201
+ assert_error_message ( ArgumentError , <<~END ) do
202
+ tried to create Proc object without a block (ArgumentError)
203
+ END
204
+
205
+ Proc . new
206
+ end
207
+ end
208
+
200
209
def test_QCALL_1
201
210
assert_error_message ( NoMethodError , <<~END ) do
202
211
undefined method `foo' for #{ ONE_RECV_MESSAGE }
You can’t perform that action at this time.
0 commit comments