Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 105484
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: mads [...] kiilerich.com
Cc: CHORNY [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Invalid warning about 'else' in 'switch' statements
Date: Thu, 25 Jun 2015 22:42:07 +0200
To: bug-Perl-Tidy [...] rt.cpan.org
From: Mads Kiilerich <mads [...] kiilerich.com>
$ echo 'switch (1) { case x { 2 } else { } }' | perltidy -se 1: expecting 'else' to follow one of 'if|elsif|unless|case|when' switch (1) { case x { 2 } else { } } $ perltidy -v | head -n1 This is perltidy, v20140711
On Thu Jun 25 16:42:34 2015, mads@kiilerich.com wrote: Show quoted text
> $ echo 'switch (1) { case x { 2 } else { } }' | perltidy -se > 1: expecting 'else' to follow one of 'if|elsif|unless|case|when' > switch (1) { > case x { 2 } else { } > } > > $ perltidy -v | head -n1 > This is perltidy, v20140711
In Perl switch is implemented with given/when operators. -- Alexandr Ciornii, http://chorny.net
Subject: Re: [rt.cpan.org #105484] Invalid warning about 'else' in 'switch' statements
Date: Thu, 25 Jun 2015 23:13:22 +0200
To: bug-Perl-Tidy [...] rt.cpan.org
From: Mads Kiilerich <mads [...] kiilerich.com>
On 06/25/2015 10:57 PM, Alexandr Ciornii via RT wrote: Show quoted text
> In Perl switch is implemented with given/when operators.
Yes, that is another way to do it. This snippet is pretty much like http://perldoc.perl.org/5.8.8/Switch.html where x is a constant as http://perldoc.perl.org/constant.html . That should work too?
This is fixed in version 20150815.