Skip to content

Commit 367c907

Browse files
authored
Merge pull request #74 from ruby/pick-ruby-core
Forward-port `Bug #21864`
2 parents 8142fc0 + 6383387 commit 367c907

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/test_error_highlight.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,10 +1085,11 @@ def test_args_CALL_1
10851085
end
10861086
end
10871087

1088+
OF_NIL_INTO_INTEGER = RUBY_VERSION < "4.1." ? "from nil to integer" : "of nil into Integer"
10881089
def test_args_CALL_2
10891090
v = []
10901091
assert_error_message(TypeError, <<~END) do
1091-
no implicit conversion from nil to integer (TypeError)
1092+
no implicit conversion #{OF_NIL_INTO_INTEGER} (TypeError)
10921093
10931094
v[nil]
10941095
^^^
@@ -1115,7 +1116,7 @@ def test_args_ATTRASGN_1
11151116
def test_args_ATTRASGN_2
11161117
v = []
11171118
assert_error_message(TypeError, <<~END) do
1118-
no implicit conversion from nil to integer (TypeError)
1119+
no implicit conversion #{OF_NIL_INTO_INTEGER} (TypeError)
11191120
11201121
v [nil] = 1
11211122
^^^^^^^^
@@ -1177,7 +1178,7 @@ def test_args_OP_ASGN1_aref_1
11771178
v = []
11781179

11791180
assert_error_message(TypeError, <<~END) do
1180-
no implicit conversion from nil to integer (TypeError)
1181+
no implicit conversion #{OF_NIL_INTO_INTEGER} (TypeError)
11811182
11821183
v [nil] += 42
11831184
^^^^^^^^^^

0 commit comments

Comments
 (0)