[#105450] [Ruby master Feature#18228] Add a `timeout` option to `IO.copy_stream` — "byroot (Jean Boussier)" <noreply@...>
Issue #18228 has been reported by byroot (Jean Boussier).
11 messages
2021/09/27
[ruby-core:105376] [Ruby master Bug#18185] BasicObject is inserted in the middle of the inheritance tree.
From:
"ufuk (Ufuk Kayserilioglu)" <noreply@...>
Date:
2021-09-22 16:43:37 UTC
List:
ruby-core #105376
Issue #18185 has been updated by ufuk (Ufuk Kayserilioglu).
This looks like a duplicate of https://bugs.ruby-lang.org/issues/18182 to me. Granted, this has more info about what is going wrong in this situation, though.
----------------------------------------
Bug #18185: BasicObject is inserted in the middle of the inheritance tree.
https://bugs.ruby-lang.org/issues/18185#change-93791
* Author: ksss (Yuki Kurihara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-09-22T10:04:55Z master 7c0230b05d) [arm64-darwin20]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
t.rb
``` ruby
#! /usr/bin/env ruby
class Mod < Module
module InstanceMethods
end
def initialize(aaa:)
include InstanceMethods
end
end
class Foo
def initialize(key:)
end
end
class Bar < Foo
include Mod.new(aaa: 1)
end
p Bar.ancestors
p Bar.new(key: 1)
```
3.0.2
```
$ ruby -v t.rb
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
[Bar, #<Mod:0x000000011e82ef50>, Mod::InstanceMethods, Foo, Object, Kernel, BasicObject]
#<Bar:0x000000011e82e640>
```
3.1.0-dev
```
$ ruby -v t.rb
ruby 3.1.0dev (2021-09-22T10:04:55Z master 7c0230b05d) [arm64-darwin20]
[Bar, #<Mod:0x000000010321f558>, Mod::InstanceMethods, BasicObject, Foo, Object, Kernel, BasicObject]
t.rb:20:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
from t.rb:20:in `new'
from t.rb:20:in `<main>'
```
I found this problem when running the Rails `db:schema:load`task.
Upon closer inspection, the following code seemed to be causing the problem.
https://github.com/rails/rails/blob/e44ce53f78fb376d8d48145e2319204a1a2ebfc9/activemodel/lib/active_model/type/date_time.rb#L8-L10
https://github.com/rails/rails/blob/e44ce53f78fb376d8d48145e2319204a1a2ebfc9/activemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rb
t.rb is a small reproduction of this problem.
This problem does not seem to occur in v3.0.2 of ruby.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>