Project

General

Profile

Actions

Bug #11022

closed

opening an eigenclass does not change the class variable definition context

Added by bughit (bug hit) about 9 years ago. Updated over 3 years ago.

Status:
Rejected
Target version:
-
ruby -v:
ruby 2.2.1p85 (2015-02-26 revision 49769) [i686-linux]
[ruby-core:<unknown>]
Tags:

Description

module Mod1

  class << Object.new

    C = 1
    @@cv = 1

    p Module.nesting,
      constants(false),
      class_variables(false),
      Mod1.class_variables(false)

  end

end
[#<Class:#<Object:0xb6913d98>>, Mod1]
[:C]
[]
[:@@cv]

Shouldn't class var resolution be relative to the current lexical class (Module.nexting.first)?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0