[ create a new paste ] login | about

Link: http://codepad.org/LPMCuszt    [ raw code | output | fork ]

Ruby, pasted on Feb 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module A
  def foo; puts 'A' end
end

module B
  def foo; puts 'B'; super; end
end

A.module_eval { include B } # why no override ???

class C
  include A
end

# must print 'A B', but only prints 'A' :(
C.new.foo


Output:
1
A


Create a new paste based on this one


Comments: