Project

General

Profile

Feature #10342

Module#deprecate_constant

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

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:65521]

Description

Proposal for Module#deprecate_constant, which marks constants referred by arguments as deprecated.

class C
  FOO = 1
  deprecate_constant :FOO
end
C::FOO #=> warning: constant C::FOO is deprecated

https://github.com/nobu/ruby/compare/Module%23deprecate_constant


Related issues

Related to Ruby trunk - Misc #10339: normalize reference to Timeout::ErrorClosedActions
Has duplicate Ruby trunk - Feature #11398: deprecate constantsClosedActions

History

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Related to Misc #10339: normalize reference to Timeout::Error added

Updated by marcandre (Marc-Andre Lafortune) over 4 years ago

The same effect can already be achieved using autoload, right?

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

Yes, autoload can do the trick, but it needs a separated file and warns only once.

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Closed
#5

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

Also available in: Atom PDF