Actions
Bug #7844
closedinclude/prepend satisfiable module dependencies are not satisfied
Description
Hello,
module P
def m; puts "P"; super; end
end
module Q
def m; puts "Q"; super; end
include P
end
module R
def m; puts "R"; super; end
prepend Q
end
module S
def m; puts "S"; super; end
include R
end
class A
def m; puts "A"; super; end
prepend P
include S
end
A.new.m #=> P, R, A, S, Q
This code has five module dependencies, but only two are satisfied.
-
Q
includesP
, which is not satisfied:P#m
precedesQ#m
. -
R
prependsQ
, which is not satisfied:R#m
precedesQ#m
. -
S
includesR
, which is not satisfied:R#m
precedesS#m
. -
A
prependsP
, which is satisfied:P#m
precedesA#m
. -
A
includesS
, which is satisfied:A#m
precedesS#m
.
Note that all the dependencies can be satisfied at all:
A.new.m #=> Q, P, A, S, R
--
Yusuke Endoh mame@tsg.ne.jp
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0