Skip to content
  • Jeremy Evans's avatar
    900e83b5
    Turn class variable warnings into exceptions · 900e83b5
    Jeremy Evans authored
    This changes the following warnings:
    
    * warning: class variable access from toplevel
    * warning: class variable @foo of D is overtaken by C
    
    into RuntimeErrors.  Handle defined?(@@foo) at toplevel
    by returning nil instead of raising an exception (the previous
    behavior warned before returning nil when defined? was used).
    
    Refactor the specs to avoid the warnings even in older versions.
    The specs were checking for the warnings, but the purpose of
    the related specs as evidenced from their description is to
    test for behavior, not for warnings.
    
    Fixes [Bug #14541]
    900e83b5
    Turn class variable warnings into exceptions
    Jeremy Evans authored
    This changes the following warnings:
    
    * warning: class variable access from toplevel
    * warning: class variable @foo of D is overtaken by C
    
    into RuntimeErrors.  Handle defined?(@@foo) at toplevel
    by returning nil instead of raising an exception (the previous
    behavior warned before returning nil when defined? was used).
    
    Refactor the specs to avoid the warnings even in older versions.
    The specs were checking for the warnings, but the purpose of
    the related specs as evidenced from their description is to
    test for behavior, not for warnings.
    
    Fixes [Bug #14541]
Loading