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).