[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
V2UgYXJlIHBsZWFzZWQgdG8gYW5ub3VuY2UgdGhlIHJlbGVhc2Ugb2YgUnVieSAzLjAuMC4gRnJv
4 messages
2020/12/25
[ruby-core:101395] [Ruby master Bug#17374] Refined methods aren't visible from a refinement's module
From:
daniel@...42.com
Date:
2020-12-10 15:03:52 UTC
List:
ruby-core #101395
Issue #17374 has been updated by Dan0042 (Daniel DeLorme).
I tried testing this and immediately ran into this issue: (in latest master)
```ruby
class Foo
module Extension
module Implementation
def foo
super(bar)
end
def bar
42
end
end
refine Foo do
prepend Implementation
end
end
def foo(value = :none)
p value
end
end
Foo.new.foo # => :none (ok)
Foo.prepend Foo::Extension::Implementation
Foo.new.foo # => :none ... not 42 as expected
```
So it appears like `Foo.prepend Foo::Extension::Implementation` has no effect. But if I just comment out the `prepend Implementation` line it works as expected. Note that there's no `using` anywhere anyway. I'm at a loss to explain what's going on here. But I think more than ever that module inclusion to define refined methods is not just "not recommended", it should be prevented by raising an error. Or at least output a warning.
----------------------------------------
Bug #17374: Refined methods aren't visible from a refinement's module
https://bugs.ruby-lang.org/issues/17374#change-89155
* Author: marcandre (Marc-Andre Lafortune)
* Status: Rejected
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
--
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>