Issue #9112 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Assigned to Closed

Support for this was implemented in commit:3556a834a2847e52162d1d3302d4c64390df1694 and commit:41582d5866ae34c57094f70f95c3d31f4a1fa4ff.

----------------------------------------
Feature #9112: Make module lookup more dynamic (Including modules into a module after it has already been included)
https://bugs.ruby-lang.org/issues/9112#change-86848

* Author: PragTob (Tobias Pfeiffer)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
If a module (M) is included into a class (C) and afterwards another module (M2) is included into the first module (M) then C does not include M2 and instances do not respond to methods defined in M2. I think instances of C should respond to methods defined in M2 and C should include M2.

I created a gist detailing the problem I have: https://gist.github.com/PragTob/7472643

I think this behavior is confusing, because if I'd reopen module M and just add methods there then instances of C can call those methods. However if I include another module in M then instances of C can not call those methods.

Any opinions on if this would be a better behavior or why it isn't?

(was unsure to file it as a bug or feature)



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>