[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78690] [Ruby trunk Bug#13044] ruby unless bug with plural conditions
From:
theotherimran@...
Date:
2016-12-16 22:09:20 UTC
List:
ruby-core #78690
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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>