Skip Menu |

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

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

People
Owner: perl [...] toby.ink
Requestors: kbj [...] capmon.dk
Cc:
AdminCc:

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



Subject: Error when generating explanation
Date: Fri, 6 Jul 2018 10:31:37 +0200
To: bug-Type-Tiny [...] rt.cpan.org
From: KB Jørgensen <kbj [...] capmon.dk>
I've whittled my test down to these two commands: Show quoted text
> kbj@kbj-dev ~ $ perl -Iperl-modules/Type-Tiny-1.002002/lib/ -e 'use Types::Standard qw(Any Dict); (Dict[foo=>Dict])->assert_valid({foo=>1, asd=>1});' > Reference {"asd" => 1,"foo" => 1} did not pass type constraint "Dict[foo=>Dict]" at -e line 1 > Reference {"asd" => 1,"foo" => 1} did not pass type constraint "Dict[foo=>Dict]" > "Dict[foo=>Dict]" constrains value at key "foo" of hash with "Dict" > "Dict" is a subtype of "HashRef" > "HashRef" is a subtype of "Ref" > Value "1" did not pass type constraint "Ref" (in $_->{"foo"}) > "Ref" is defined as: (!!ref($_)) > kbj@kbj-dev ~ $ perl -Iperl-modules/Type-Tiny-1.002002/lib/ -e 'use Types::Standard qw(Any Dict); (Dict[foo=>Any])->assert_valid({foo=>1, asd=>1});' > Use of uninitialized value $tc in substitution (s///) at perl-modules/Type-Tiny-1.002002/lib/Type/Registry.pm line 171. > Use of uninitialized value $tc in exists at perl-modules/Type-Tiny-1.002002/lib/Type/Registry.pm line 173. > Use of uninitialized value $_[0] in exists at perl-modules/Type-Tiny-1.002002/lib/Type/Library.pm line 268. > Expected token; got empty string at perl-modules/Type-Tiny-1.002002/lib/Type/Parser.pm line 400.
The first gives an explanation for the validation error and the second fails at that. -- Sincerely KB Jørgensen System Developer CapMon A/S
Hmm, interesting. I have no idea why Type::Parser is even getting invoked. That module is used for taking a string type name like: my $typename = "ArrayRef[Int]"; And parsing it to create a type constraint object. I'll try to get this fixed in time for 1.004000.
Dev release 1.003_008 includes this fix.
Fixed in 1.004000.