From: theotherimran@... Date: 2016-12-16T22:09:20+00:00 Subject: [ruby-core:78690] [Ruby trunk Bug#13044] ruby unless bug with plural conditions Issue #13044 has been reported by Imran Ashraf. ---------------------------------------- Bug #13044: ruby unless bug with plural conditions https://bugs.ruby-lang.org/issues/13044 * Author: Imran Ashraf * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- I am working on an app where I need to process various data-items based upon different ruby types. While setting up conditonal-checks, I discovered that "unless" fails to handle plural conditions. Please consider the following example: ~~~ class ThingA end class ThingB end class ThingC end # obj = ThingA.new # obj = ThingB.new obj = ThingC.new # puts 'yes it is a ThingC' unless obj.is_a?(ThingA) && obj.is_a?(ThingB) # BUG # puts 'yes it is a ThingC' if !obj.is_a?(ThingA) && !obj.is_a?(ThingB) # this works ok # works ok with singular condition unless obj.is_a?(ThingA) unless obj.is_a?(ThingB) puts 'yes it is a ThingC' end end ~~~ Thanks. Regards, Imran -- https://bugs.ruby-lang.org/ Unsubscribe: