Forum: IronRuby Annoymous class extending a module doesn't return expected kind_of

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ben H. (Guest)
on 2008-10-06 05:29
(Received via mailing list)
Hi guys,

I've been bashing my head again this problem for the last few days
where the object I expected wasn't passed around, tonight I decided to
break it down and focus on a much small part.  Turns out, I was
looking in the wrong part.

This is what I think the problem is. The code is creating an anonymous
class which is extending a module.  The code then does a kind_of? to
decide what to do with it.

>From what I can tell, it looks like the kind_of doesn't recognize the
modules it is extending.  This is the code which demonstrates the

Code Repro:
module AAA
   class << self
     def a
      puts "Hello"

  def myAAA
    klass = do
        extend AAA

    puts "Am I a type of what I extended (AAA)?"
    puts klass.kind_of?(AAA)

class XYZ
  include AAA

$a =

With MRI, true is returned.  With IronRuby, false is returned.


E:\IronRuby\trunk\build\debug>ruby array_test
Am I a type of what I extended (AAA)?

E:\IronRuby\trunk\build\debug>ir array_test
Am I a type of what I extended (AAA)?

This has blocked me moving on.  Anyone got any ideas?

Any help on this would be great!


Curt H. (Guest)
on 2008-10-06 09:34
(Received via mailing list)
This is working for me with our internal sources but not with what's
current in RubyForge.  I think we might be a few days behind on the sync
-- you should see it working after the next one happens.
Stefan D. (Guest)
on 2008-10-06 10:29
(Received via mailing list)
There was a discussion about this some time ago.

Here it is:
The reported bug is here:


2008/10/6 Ben H. <removed_email_address@domain.invalid>
Ben H. (Guest)
on 2008-10-06 13:45
(Received via mailing list)
Hi Curt,

Any ideas when the next release will happen? Is this going to be a
post PDC thing?

Ben H. (Guest)
on 2008-10-06 13:45
(Received via mailing list)
Hi Stefan,

Looks like you are working on the same item as me :)

This is the last problem I have I think to run unmodified RSpec, well
until I hit the next thing :)

Curt H. (Guest)
on 2008-10-06 18:48
(Received via mailing list)
Oh, no -- we're doing it pretty regularly.  I think there's just been a
short delay while we pull in Peter's work and that we'll probably push
back out in the next two days.  We're totally not optimized for outside
contributions at this point, but "working from a single repository" is
on someone's list of commitments for the next year.
Ben H. (Guest)
on 2008-10-06 19:33
(Received via mailing list)
Excellent. I'll continue with my work around until then :)

I'll go over the changes i've made locally and raise bugs where
required tonight.  Sadly, they are all core so I can't submit them


John L. (IRONRUBY) (Guest)
on 2008-10-06 20:15
(Received via mailing list)
This topic is locked and can not be replied to.