Project

General

Profile

Actions

Bug #14552

closed

Kernel#Integer can return a non-Integer object.

Added by mrkn (Kenta Murata) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.6.0dev (2018-02-25 trunk 62575) [x86_64-darwin16]
[ruby-core:85813]

Description

I found a bug that Kernel#Integer returns any non-nil object which is a result of to_int.

obj = Object.new
def obj.to_int
  "str"
end
Integer(obj) #=> "str"
Actions

Also available in: Atom PDF

Like0
Like0