Actions
Bug #19343
closedInteger#ceildiv should respect #coerce
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
Description
https://github.com/ruby/ruby/pull/7118
This issue is similar to #19335.
c = Object.new
def c.coerce(other) = [other, 10]
p 1234 / c # => 123
p 1234.div(c) # => 123
p 1234.quo(c) # => (617/5)
p 1234.fdiv(c) # => 123.4
p 1234.ceildiv(c) # => in `ceildiv': undefined method `-@' for #<Object:0x000000010250ad68> (NoMethodError)
Updated by kyanagi (Kouhei Yanagita) almost 2 years ago
- Subject changed from Integer#ceildiv should respece #coerce to Integer#ceildiv should respect #coerce
Updated by kyanagi (Kouhei Yanagita) almost 2 years ago
- Status changed from Open to Closed
Applied in changeset git|20a85ab6119964d1ff129f9c6676fa2a7b2a2be4.
Fix Integer#ceildiv to respect #coerce (#7118)
Fixes [Bug #19343]
Actions
Like0
Like0Like0