From: Ryan Davis Date: 2011-07-18T11:22:20+09:00 Subject: Re: duplicated when clause is ignored On Jul 17, 2011, at 13:37 , Stefano Mioli wrote: > On 7/17/11 9:25 PM, Brian Candler wrote: >> Stefano Mioli wrote in post #1011159: >>> x = 1 >>> case x >>> when 0 >>> when 1 >>> when 1 + 0 >>> when 1 >>> end >>> >>> is enough to fool iseq_set_sequence(), making it print out no warnings >>> at all, even though we still *do* have a duplicate 'when' clause (let >>> alone that there are actually 3 duplicated clauses). >>> >>> I wonder if I should file a ticket. >> >> It isn't necessarily duplicated. You might have redefined Numeric#+ to >> have a side-effect. It would be a silly thing to do, but Ruby doesn't >> know you've not done that. > > True, but there are still two identical "when 1". > My point is that adding a "when 1 + 0" between them makes the warning go away when it shouldn't. > > Or am I missing something? I don't think you're missing anything. Considering the following causes the warning as well: x = 1 case x when 1 when 0 when 1 end I think you came up with a bug. Could you file a ticket on ruby-core's rubymine tracker?