Projects

Ticket #265 (closed defect: fixed)

Opened 3 years ago

Last modified 9 months ago

'include' on 'class Class' doesn't define methods on future classes

Reported by: nate@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.11
Component: MacRuby Keywords:
Cc: nate@…

Description

Greetings, the following code sample works on ruby 1.8 and 1.9 but is giving an error in MacRuby 0.0.4.

module B
  def whisper(a)
    puts a.downcase
  end
end

class Class
  include B
  def say(a)
    puts a
  end
end

class A
  say("hi")
  whisper("BYE")
end

# ruby 1.8.* & 1.9.* =>
# hi
# bye 
#
# macruby 0.0.4 =>
# hi
# class.rb:16:in `<class:A>': undefined method `whisper' for A:Class (NoMethodError)
#  from class.rb:14:in `<main>'

Change History

Changed 3 years ago by nate@…

  • cc nate@… added

Cc Me!

Changed 3 years ago by nate@…

An interesting note is that if you change class Class to class Object it works in both mri and macruby.

Changed 9 months ago by kouji@…

Now, this is fixed in HEAD(fbaff4e856e686792775da89e660acc163c5f29f). I think this ticket would be close.

Changed 9 months ago by lsansonetti@…

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

Verified that it's working, closing.

Note: See TracTickets for help on using tickets.