From: muraken@... Date: 2016-06-13T14:53:58+00:00 Subject: [ruby-core:76000] [Ruby trunk Bug#12485] Kernel.Rational raises TypeError though given denominator returns 1 by to_int Issue #12485 has been updated by Kenta Murata. File rational.c.diff added Attached patch can fix this issue. ---------------------------------------- Bug #12485: Kernel.Rational raises TypeError though given denominator returns 1 by to_int https://bugs.ruby-lang.org/issues/12485#change-59198 * Author: Kenta Murata * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Is it an intentional behavior? ```ruby class << (o = Object.new) def to_int 1 end end Rational(1, o) #=> TypeError: not an integer ``` ---Files-------------------------------- rational.c.diff (539 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: