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