Project

General

Profile

Actions

Bug #17388

closed

Doesn't Warning.warn support `category: :experimental` in Ruby 3.0.0?

Added by jnchito (Junichi Ito) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0preview2 (2020-12-08 master d7a16670c3) [x86_64-darwin20]
[ruby-core:101427]

Description

I wrote the following script:

module Warning
  def self.warn(message, category: nil)
    puts "category=#{category}"
    super
  end
end
lambda(&:foo).lambda?
Ractor.new{}

Then, run it:

$ ruby -w ~/Desktop/test.rb
category=deprecated
/Users/jnito/Desktop/test.rb:7: warning: lambda without a literal block is deprecated; use the proc without lambda instead
category=
<internal:ractor>:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.

I got category=deprecated as I expected, but got nil instead of :experimental. I feel it should be :experimental.

This issue is related to https://bugs.ruby-lang.org/issues/17122


Files

experimental.diff (5.2 KB) experimental.diff Patch for experimental warning category support jeremyevans0 (Jeremy Evans), 12/14/2020 08:34 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0