summaryrefslogtreecommitdiff
path: root/NEWS.md
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-01-14 11:59:25 -0800
committerJeremy Evans <code@jeremyevans.net>2021-01-14 20:43:30 -0800
commite09094546a19d6b62b3e21d0b061b103cf21f760 (patch)
tree3b0cacf97950307ef79bbef1abf445e213f1820a /NEWS.md
parent1cb0c5ac49e180cca060e3a17eba6c561f5330c2 (diff)
Make Module#prepend affect ancestor chain even if argument already included in receiver
Previously, if a class included a module and then prepended the same module, the prepend had no effect. This changes the behavior so that the prepend has an effect unless the module is already prepended the receiver. While here, rename the origin_seen variable in include_modules_at, since it is misleading. The variable tracks whether c has been seen, not whether the origin of klass has been. Fixes [Bug #17423]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4072
Diffstat (limited to 'NEWS.md')
-rw-r--r--NEWS.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 1e3202c235..962a777f8b 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -21,6 +21,13 @@ Outstanding ones only.
* Enumerator::Lazy#compact is added. [[Feature #17312]]
+* Module
+
+ * Module#prepend now modifies the ancestor chain if the receiver
+ already includes the argument. Module#prepend still does not
+ modify the ancestor chain if the receiver has already prepended
+ the argument. [[Bug #17423]]
+
## Stdlib updates
Outstanding ones only.
@@ -49,3 +56,4 @@ Excluding feature bug fixes.
[Feature #17312]: https://bugs.ruby-lang.org/issues/17312
+[Bug #17423]: https://bugs.ruby-lang.org/issues/17423