[#69616] [Ruby trunk - Feature #11258] add 'x' mode character for O_EXCL — cremno@...
Issue #11258 has been updated by cremno phobia.
3 messages
2015/06/16
[#69643] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — normalperson@...
Issue #11276 has been updated by Eric Wong.
3 messages
2015/06/17
[#69751] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function. — kubo@...
Issue #11001 has been updated by Takehiro Kubo.
3 messages
2015/06/27
[ruby-core:69472] [Ruby trunk - Bug #11228] [Open] Classes Cannot be used in case Statements
From:
martin.vahi@...1.com
Date:
2015-06-05 23:21:59 UTC
List:
ruby-core #69472
Issue #11228 has been reported by Martin Vahi.
----------------------------------------
Bug #11228: Classes Cannot be used in case Statements
https://bugs.ruby-lang.org/issues/11228
* Author: Martin Vahi
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~
#!/usr/bin/env ruby
def flaw_demo
cl_selector="A String instance".class
case cl_selector
when String
puts "flaw_demo: This is, where the control flow should be."
when Regexp
puts "flaw_demo: Hi Regexp!"
else
puts "flaw_demo: The control flow should not reach this line."
end # case
end ; flaw_demo()
CONST_1=42
CONST_2=99
def works_ok
i_selector=42
case i_selector
when CONST_1
puts " works_ok: This is, where the control flow should be."
when CONST_2
puts " works_ok: Hi CONST_2!"
else
puts " works_ok: The control flow should not reach this line."
end # case
end ; works_ok()
# Console output:
# flaw_demo: The control flow should not reach this line.
# works_ok: This is, where the control flow should be.
~~~
---Files--------------------------------
test_case.rb (798 Bytes)
--
https://bugs.ruby-lang.org/