Issue #16297 has been updated by usa (Usaku NAKAMURA).


usa (Usaku NAKAMURA) wrote in #note-1:
> ruby_2_6 r67896 merged revision(s) f72dc407.

note that ruby_2_6 does not have `UnboundMethod#bind_call`.

----------------------------------------
Bug #16297: calling undefined allocator by `Class.instance_method(:allocate)`
https://bugs.ruby-lang.org/issues/16297#change-90650

* Author: nobu (Nobuyoshi Nakada)
* Status: Closed
* Priority: Normal
* Backport: 2.5: REQUIRED, 2.6: DONE
----------------------------------------
For instance, `Rational.allocate` is undefined.

```ruby
Rational.allocate #=> undefined method `allocate' for Rational:Class (NoMethodError)
```

But it can be called by `Class.instance_method(:allocate)`.

```ruby
Class.instance_method(:allocate).bind_call(Rational) #=> (0/1)
Class.instance_method(:allocate).bind(Rational).call #=> (0/1)
```

These allocators are defined for Marshal, and undefined as methods.




-- 
https://bugs.ruby-lang.org/