[#108552] [Ruby master Bug#18782] Race conditions in autoload when loading the same feature with multiple threads. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18782 has been reported by ioquatix (Samuel Williams).
11 messages
2022/05/14
[ruby-core:108679] [Ruby master Bug#18799] Refinement#import_methods vs attr_reader
From:
"Eregon (Benoit Daloze)" <noreply@...>
Date:
2022-05-24 19:53:32 UTC
List:
ruby-core #108679
Issue #18799 has been updated by Eregon (Benoit Daloze).
> is not defined with Ruby code
It means the method's body is not Ruby code. And indeed, `attr_*` defines methods which are not defined in/with Ruby code.
So this seems expected.
Same for define_method, which has some internal wrapper around the given block and so cannot easily be import-ed.
----------------------------------------
Bug #18799: Refinement#import_methods vs attr_reader
https://bugs.ruby-lang.org/issues/18799#change-97720
* Author: palkan (Vladimir Dementyev)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Currently, it's not possible to import methods defined as attr_{reader, accessor,writer}:
```ruby
module M
attr_reader :fuu
end
module R
refine Object do
import_methods M
end
end
#=> Can't import method which is not defined with Ruby code: M#fuu (ArgumentError)
```
Is that a known/intentional limitation or a bug? From the error message it might seem that this is a bug (since `attr_smth` is a Ruby code).
--
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>