Issue #14552 has been reported by mrkn (Kenta Murata).

----------------------------------------
Bug #14552: Kernel#Integer can return a non-Integer object.
https://bugs.ruby-lang.org/issues/14552

* Author: mrkn (Kenta Murata)
* Status: Assigned
* Priority: Normal
* Assignee: mrkn (Kenta Murata)
* Target version: 2.6
* ruby -v: ruby 2.6.0dev (2018-02-25 trunk 62575) [x86_64-darwin16]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
I found a bug that Kernel#Integer returns any non-nil object which is a result of to_int.

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



-- 
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>