[#99115] [Ruby master Bug#17023] How to prevent String memory to be relocated in ruby-ffi — larskanis@...
Issue #17023 has been reported by larskanis (Lars Kanis).
22 messages
2020/07/10
[#99375] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings — merch-redmine@...
Issue #17055 has been reported by jeremyevans0 (Jeremy Evans).
29 messages
2020/07/28
[#101207] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— merch-redmine@...
2020/12/02
Issue #17055 has been updated by jeremyevans0 (Jeremy Evans).
[#101231] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— Austin Ziegler <halostatue@...>
2020/12/03
What does this mean?
[ruby-core:99244] [Ruby master Bug#17038] On master, ancestry edits can lead to duplicates in Module#ancestors
From:
merch-redmine@...
Date:
2020-07-21 00:50:39 UTC
List:
ruby-core #99244
Issue #17038 has been updated by jeremyevans0 (Jeremy Evans).
I believe it's always been possible to have duplicates in ancestors, even before this change:
```ruby
class A
end
class B < A
end
module C
end
B.include C
A.include C
B.ancestors
# => [B, C, A, C, Object, Kernel, BasicObject]
```
Making include/prepend affect iclasses certainly makes duplicates in ancestors more likely, though.
I don't think this is a bug. If you think it is a bug, can you describe what you consider the correct behavior to be?
----------------------------------------
Bug #17038: On master, ancestry edits can lead to duplicates in Module#ancestors
https://bugs.ruby-lang.org/issues/17038#change-86628
* Author: alanwu (Alan Wu)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.8.0dev (2020-07-20T06:39:31Z master 935d0b3d05) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Running the following [script](https://wandbox.org/permlink/0f48S2QhvEO1cOBF) on master(935d0b3d05dfc8b30bba505792129bf0e33ebe3b),
`A` appears three times in the lookup chain of `C` and `A#foo` is called multiple
times with `super`.
```ruby
module A
def foo
[:a] + super
end
end
module B
def foo
[:b] + super
end
end
class Object
def foo
[:object]
end
end
module C
def foo
[:c] + super
end
end
class D
prepend A
include C
include B
def foo
[:d] + super
end
end
B.include A
C.include A
p D.ancestors
p D.new.foo
p RUBY_REVISION
__END__
[A, D, B, A, C, A, Object, Kernel, BasicObject]
[:a, :d, :b, :a, :c, :a, :object]
"935d0b3d05dfc8b30bba505792129bf0e33ebe3b"
```
This change was introduced in #9573. Is this behavior intentional?
In my opinion it's a bit odd since it's not possible to have duplicates
in the lookup chain on released versions. Allowing duplicates can
surprise peopole that are used to not having duplicates and lead to bugs.
If `A#foo` had side effects, for example, calling it multiple times
could be undesirable.
Also, logically it doesn't make sense to have a module be the ancestor of itself.
Comparison operators make less sense with this new setup.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>