[#102393] [Ruby master Feature#17608] Compact and sum in one step — sawadatsuyoshi@...

Issue #17608 has been reported by sawa (Tsuyoshi Sawada).

13 messages 2021/02/04

[#102438] [Ruby master Bug#17619] if false foo=42; end creates a foo local variable set to nil — pkmuldoon@...

Issue #17619 has been reported by pkmuldoon (Phil Muldoon).

10 messages 2021/02/10

[#102631] [Ruby master Feature#17660] Expose information about which basic methods have been redefined — tenderlove@...

Issue #17660 has been reported by tenderlovemaking (Aaron Patterson).

9 messages 2021/02/27

[#102639] [Ruby master Misc#17662] The herdoc pattern used in tests does not syntax highlight correctly in many editors — eregontp@...

Issue #17662 has been reported by Eregon (Benoit Daloze).

13 messages 2021/02/27

[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...

Issue #17664 has been reported by ciconia (Sharon Rosner).

23 messages 2021/02/28

[ruby-core:102433] [Ruby master Bug#17590] `M.prepend M` has hidden side effect

From: merch-redmine@...
Date: 2021-02-10 00:04:15 UTC
List: ruby-core #102433
Issue #17590 has been updated by jeremyevans0 (Jeremy Evans).


There are two issues I noted here.  One is that cyclic prepends modify the ancestor chain before raising an exception.  A simple fix for that is to scan the module ancestor chain to look for a cyclic prepend before making a modification.  I've submitted a pull request to fix that: https://github.com/ruby/ruby/pull/4165

That doesn't fix the issue in this example.  The problem in this example is due to the optimization in commit:37e6c83609ac9d4c30ca4660ee16701e53cf82a3.  I've tested reverting that commit and you get the expected result after doing so.  However, that commit contains an important optimization.  I don't see Alan Wu as an assignee on Redmine, so I'll commit on the related GitHub commit and see if he can look into it.

----------------------------------------
Bug #17590: `M.prepend M` has hidden side effect
https://bugs.ruby-lang.org/issues/17590#change-90316

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
* Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: UNKNOWN
----------------------------------------
`M.prepend M` raises ArgumentError, but it has hidden side effect.

```ruby
module M; end
class C; end
C.prepend M
C.include M
M.prepend M rescue nil
module M2; end
M2.prepend M
C.include M2
p C.ancestors # => [M, C, M2, M, M2, Object, Kernel, BasicObject]
```

```ruby
module M; end
class C; end
C.prepend M
C.include M
module M2; end
M2.prepend M
C.include M2
p C.ancestors # => [M, C, M2, Object, Kernel, BasicObject]
```



-- 
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>

In This Thread

Prev Next