Project

General

Profile

Actions

Bug #16297

closed

calling undefined allocator by `Class.instance_method(:allocate)`

Added by nobu (Nobuyoshi Nakada) over 4 years ago. Updated 3 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-dev:50856]

Description

For instance, Rational.allocate is undefined.

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

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

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0