Project

General

Profile

Actions

Bug #7844

closed

include/prepend satisfiable module dependencies are not satisfied

Added by mame (Yusuke Endoh) about 11 years ago. Updated over 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2013-02-13 trunk 39225) [x86_64-linux]
Backport:
[ruby-core:52208]
Tags:

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 includes P, which is not satisfied: P#m precedes Q#m.
  • R prepends Q, which is not satisfied: R#m precedes Q#m.
  • S includes R, which is not satisfied: R#m precedes S#m.
  • A prepends P, which is satisfied: P#m precedes A#m.
  • A includes S, which is satisfied: A#m precedes S#m.

Note that all the dependencies can be satisfied at all:

A.new.m #=> Q, P, A, S, R

--
Yusuke Endoh


Files

include-after-origin-7844.patch (2.61 KB) include-after-origin-7844.patch jeremyevans0 (Jeremy Evans), 08/08/2019 05:05 PM

Related issues 3 (0 open3 closed)

Related to Ruby master - Bug #14704: Module#ancestors looks wrong when a module is both included and prepended in the same class.ClosedActions
Related to Ruby master - Bug #17423: `Prepend` should prepend a module before the classClosedjeremyevans0 (Jeremy Evans)Actions
Related to Ruby master - Bug #18064: Backport fix for bug 7844 (include/prepend satisfiable module dependencies are not satisfied)ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0