Project

General

Profile

Actions

Bug #5068

closed

Issue with "duplicated when clause is ignored"

Added by sm (Stefano Mioli) over 13 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.2-p{180,290}
Backport:
[ruby-core:38343]

Description

I'm filing this ticket as suggested by Ryan Davis here:

http://www.ruby-forum.com/topic/2154866#1011303

Let's consider this snippet:

x = 0
case x
when 1
when 0
when 1
end

Executing a file containing this code with ruby -w, the interpreter will print out this warning:

warning: duplicated when clause is ignored

Let's consider this one instead:

x = 0
case x
when 1
when 0 + 1
when 1
end

This will not print out the same warning, even though we still have a duplicated 'when'.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0