On Sat Jun 01 22:12:45 2019, DJERIUS wrote:
Show quoted text> On Sat Jun 01 21:30:22 2019, DJERIUS wrote:
> > The following code
> >
> > use strict;
> > use warnings;
> >
> > use Types::Standard qw[ Bool Enum ];
> >
> > my $x = Bool | Enum [ 'start-end', 'end' ];
> >
> > produces an error:
> >
> > Expected R_BRACKET; got TYPE at
> > [...]/lib/site_perl/5.28.1/Type/Parser.pm line 391.
> >
> > Changing the '-' in 'start-end' to any other character (well, any
> > that
> > I've tried!) makes it behave.
>
>
> On further investigation, I can't reproduce this on a clean install of
> Type::Tiny on a clean install of Perl.
>
> Still investigating...
The unexpected behavior requires Type::Tiny::XS to be installed. With it:
% perl -d:Modlist -Ilocal/lib/perl5 opt.pl
Expected R_BRACKET; got TYPE at local/lib/perl5/Type/Parser.pm line 391.
B 1.74
Error::TypeTiny 1.004004
Eval::TypeTiny 1.004004
Exporter 5.73
Exporter::Tiny 1.002001
List::Util 1.5
Scalar::Util 1.5
Sub::Util 1.5
Type::Coercion 1.004004
Type::Library 1.004004
Type::Parser 1.004004
Type::Tiny 1.004004
Type::Tiny::Enum 1.004004
Type::Tiny::Union 1.004004
Type::Tiny::XS 0.014
Types::Standard 1.004004
Types::TypeTiny 1.004004
XSLoader 0.30
overload 1.30
overloading 0.02
re 0.36
warnings 1.42
warnings::register 1.04
Without it:
% perl -d:Modlist -Ilocal/lib/perl5 opt.pl
B 1.74
Eval::TypeTiny 1.004004
Exporter 5.73
Exporter::Tiny 1.002001
List::Util 1.5
Scalar::Util 1.5
Sub::Util 1.5
Type::Coercion 1.004004
Type::Coercion::Union 1.004004
Type::Library 1.004004
Type::Tiny 1.004004
Type::Tiny::Enum 1.004004
Type::Tiny::Union 1.004004
Types::Standard 1.004004
Types::TypeTiny 1.004004
XSLoader 0.30
overload 1.30
overloading 0.02
re 0.36
warnings 1.42
warnings::register 1.04