Project

General

Profile

Actions

Bug #17523

closed

Inconsistent Warning[] values in scripts loaded by -r option

Added by nobu (Nobuyoshi Nakada) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:101991]

Description

While -w option affects $VERBOSE for both the main and required scripts, but affects Warning[] values only in the main script.

In this example, Warning[:deprecated] should be consistent as well as $VERBOSE.

v.rb
p $VERBOSE
p %i[deprecated experimental].to_h{|i|[i,Warning[i]]}
result
$ ruby -w -r./v -e 'p $VERBOSE, %i[deprecated experimental].to_h{|i|[i,Warning[i]]}'
true
{:deprecated=>false, :experimental=>true}
true
{:deprecated=>true, :experimental=>true}
patch
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0