Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 121751
Status: resolved
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: CHOROBA [...] cpan.org
Cc:
AdminCc:

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



Subject: Fat comma after newline stopped working in Util::TypeConstraints
After updating Moose from 2.1605 to 2.2005, previously working code stopped working and emitted weird syntax errors. I was able to reduce the example to the following: script.pl --------- #! /usr/bin/perl use Test::Simple tests => 1; require My::Class; ok 1; My/Class.pm ----------- package My::Class; use Moose::Util::TypeConstraints; subtype 'My::Type' => as Object => where { 0 }; 1; In the older version, the test passes, in the more recent one, the script throws Number found where operator expected at My/Class.pm line 9, near "1" (Missing semicolon on previous line?) syntax error at My/Class.pm line 9, near "1" Compilation failed in require at ./1.pl line 3. Possible workarounds include moving the semicolon to the following line, quoting Object, or moving the fat comma from before "where" to after "Object" (i.e. over the newline).
BTW, perl 5.18.2 on Linux (OpenSUSE 42.2), previously 5.18.2 on 42.1. (And the script name was original 1.pl, as you can see in the error message). Choroba
On Wed May 17 23:24:48 2017, CHOROBA wrote: Show quoted text
> After updating Moose from 2.1605 to 2.2005, previously working code > stopped working and emitted weird syntax errors.
It is not Moose that got upgraded, but rather Test::More underneath it. This line https://github.com/Test-More/test-more/blob/29803fc0/lib/Test2/Util/HashBase.pm#L16 reifies the Object:: stash/namespace, and tickles this bug in the interpreter: https://github.com/Perl/perl5/commit/21791330. Amusingly Moose itself had to have its tests fixed for an identical problem back in https://github.com/moose/Moose/pull/141 Sadly there isn't good robust advice to give here, aside from "quote your types" :/ Cheers
Marking this resolved since it's not a Moose bug.