Skip to content

Commit 764f883

Browse files
committed
Remove deprecated method Kernel#=~
1 parent ff3b5cd commit 764f883

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

spec/tags/core/kernel/match_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/ruby/truffleruby/core/kernel.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,8 @@ def `(str) #`
181181
end
182182
module_function :` # `
183183

184-
def =~(other)
185-
warn "deprecated Object#=~ is called on #{Primitive.class(self)}; it always returns nil", uplevel: 1 if $VERBOSE
186-
nil
187-
end
188-
189184
def !~(other)
190-
r = self =~ other ? false : true
185+
r = self.respond_to?(:=~) ? !(self =~ other) : true
191186
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
192187
r
193188
end

0 commit comments

Comments
 (0)