Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 132455
Status: resolved
Priority: 0/
Queue: Type-Tiny

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

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



Subject: interesting parsing differences with parameterized types on 5.10
Travis found this bug for me on perls 5.10 and 5.12 (not 5.14). I ran it through Deparse as well to see the difference (note that the "bar" key in the Dict has been lost on earlier perls): on 5.31.10: perl -MTypes::Standard=Dict,InstanceOf,HashRef,Str -wle'my $isa = Dict[ foo => InstanceOf["Path::Tiny"]|HashRef, bar => Str ]; print $isa' Dict[bar=>Str,foo=>InstanceOf["Path::Tiny"]|HashRef] perl -MO=Deparse,-p -MTypes::Standard=Dict,InstanceOf,HashRef,Str -wle'my $isa = Dict[ foo => InstanceOf["Path::Tiny"]|HashRef, bar => Str ]; print $isa' BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use Types::Standard (split(/,/, 'Dict,InstanceOf,HashRef,Str', 0)); (my $isa = &Dict(['foo', (&InstanceOf(['Path::Tiny']) | &HashRef()), 'bar', &Str()])); print($isa); -e syntax OK on 5.10.1: perl -MTypes::Standard=Dict,InstanceOf,HashRef,Str -wle'my $isa = Dict[ foo => InstanceOf["Path::Tiny"]|HashRef, bar => Str ]; print $isa' Dict[foo=>InstanceOf["Path::Tiny"]|HashRef] perl -MO=Deparse,-p -MTypes::Standard=Dict,InstanceOf,HashRef,Str -wle'my $isa = Dict[ foo => InstanceOf["Path::Tiny"]|HashRef, bar => Str ]; print $isa' BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use Types::Standard (split(/,/, 'Dict,InstanceOf,HashRef,Str', 0)); (my $isa = Dict(['foo', InstanceOf((['Path::Tiny'] | HashRef()), 'bar', Str)])); print($isa); -e syntax OK The extra key is not lost if parentheses are added, like so: perl -MTypes::Standard=Dict,InstanceOf,HashRef,Str -wle'my $isa = Dict[ foo => (InstanceOf["Path::Tiny"]|HashRef), bar => Str ]; print $isa' Dict[bar=>Str,foo=>InstanceOf["Path::Tiny"]|HashRef]
Fix will be released to CPAN tomorrow.
Was fixed in 1.010002.