I know Ruby tests whether a module is already included, and doesn't
include it again when it was included already. However the following code
circumvents that check (swap the two includes and Ruby does catch it):

  class A
    def m ; super if defined? super ; end
  end

  class B < A
    def m ; super if defined? super ; end
  end

  module M
    def m ; super if defined? super ; end
  end

  class B
    include M
  end

  class A
    include M
  end

  B.new.m

This is not a big problem I guess (except that order matters while maybe
it shouldn't), but the bigger problem is that a call to B#m goes in an
infinite loop. I constructed the above test case when I noticed a possible
problem in the Ruby source, so I know why it happens; I'm just wondering
whether it is considered a known issue not worth solving. I guess it may
not be that common to call super in a module, but we are using this for
AOP and there it does happen. (Though I'm not sure the double include
would occur.)

Peter