From: shugo@... Date: 2020-12-11T00:54:09+00:00 Subject: [ruby-core:101406] [Ruby master Bug#17386] Refinements breaks prepend Issue #17386 has been reported by shugo (Shugo Maeda). ---------------------------------------- Bug #17386: Refinements breaks prepend https://bugs.ruby-lang.org/issues/17386 * Author: shugo (Shugo Maeda) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.0dev (2020-12-10T22:40:29Z master 6b1d2de6cc) [x86_64-darwin19] * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED ---------------------------------------- Reported in https://bugs.ruby-lang.org/issues/17379#note-5, but it seems a different issue from #17379 because Ruby 2.7.2 or earlier is not affected. ``` excelsior:/tmp$ cat t.rb class Foo def foo p :hello end end module Code def foo p :A end end module Extension refine Foo do prepend Code end end Foo.new.foo unless ENV['SKIP'] # => :hello (ok) Foo.prepend Code Foo.new.foo # => depends (not ok) excelsior:/tmp$ ruby -v t.rb ruby 3.0.0dev (2020-12-10T22:40:29Z master 6b1d2de6cc) [x86_64-darwin19] :hello :hello excelsior:/tmp$ SKIP=t ruby -v t.rb ruby 3.0.0dev (2020-12-10T22:40:29Z master 6b1d2de6cc) [x86_64-darwin19] :A excelsior:/tmp$ RBENV_VERSION=2.7.2 ruby -v t.rb ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] :hello :A excelsior:/tmp$ SKIP=t RBENV_VERSION=2.7.2 ruby -v t.rb ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] :A ``` -- https://bugs.ruby-lang.org/ Unsubscribe: