Project

General

Profile

Bug #14719 » simple_delegator_on_boolean_with_simple_equals_override.rb

theirishpenguin (Declan McGrath), 04/27/2018 04:17 PM

 
#!/usr/bin/env ruby

class BoldBool < SimpleDelegator
def equal?(obj)
true
end
end

false_bool = BoldBool.new(false)

if false_bool
puts "I'm evaluated as true but I should be false."
end
(3-3/3)