Skip to content

Commit

Permalink
Suppress runtime warnings
Browse files Browse the repository at this point in the history
* deprecated constant accesses
  • Loading branch information
nobu committed Oct 24, 2023
1 parent 36cfc9f commit df480f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rbs/prototype/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,15 @@ def const_name(const)
return nil unless name

begin
deprecated, Warning[:deprecated] = Warning[:deprecated], false
Object.const_get(name)
rescue NameError
# Should generate const name if anonymous or internal module (e.g. NameError::message)
nil
else
name
ensure
Warning[:deprecated] = deprecated
end
end

Expand Down

0 comments on commit df480f3

Please sign in to comment.