Projects

Ticket #564 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

Scoping within nested classes is broken

Reported by: joshua.ballanco@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.6
Component: MacRuby Keywords: module
Cc:

Description

The following code throws an 'uninitialize constant: A::C::D::B' error, when it should actually just find the module "B" --

module A
  module B
  end

  class C
  end

  class C::D
    include B
  end
end

Note: Removing the surrounding "module A" eliminates the lookup problem.

Change History

Changed 7 months ago by martinlagardette@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.6

Looks fixed!

$ cat test.rb
module A
  module B
    def lestry
      puts "yay!"
    end
  end

  class C
  end

  class C::D
    include B
  end
end

A::C::D.new.lestry

$ macruby test.rb
yay!

I guess I can close? :P

Note: See TracTickets for help on using tickets.