HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-3.0.2/spec/ruby/core/kernel/fixtures/warn_core_method.rb
raise 'should be run without RubyGems' if defined?(Gem)

def deprecated(n=1)
  # puts nil, caller(0), nil
  warn "use X instead", uplevel: n
end

1.times do # to test with a non-empty stack above the reported locations
  deprecated
  tap(&:deprecated)
  tap { deprecated(2) }
  # eval sources with a <internal: file are also ignored
  eval "tap(&:deprecated)", nil, "<internal:should-be-skipped-by-warn-uplevel>"
end