Skip Menu |

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

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

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

Bug Information
Severity: (no value)
Broken in: 0.019
Fixed in:
  • 0.020
  • 0.021



Subject: Tuple+Enum constraints on strings with spaces fail when Type::Tiny::XS is installed
Here's a simple program showing the error: use strict; use warnings; use Type::Utils -all; use Types::Standard -types; my $type = declare as Tuple[Enum["foo bar", "foo baz"], Str]; $type->assert_valid(["foo bar", "whatever"]); $type->assert_valid(["foo baz", "whatever"]); $type->assert_valid(["foo bay", "whatever"]); When Type::Tiny::XS is installed (unexpected): Expected R_BRACKET; got TYPE at /Users/aeruder/.perl5/perls/perl-5.32.0/lib/site_perl/5.32.0/Type/Parser.pm line 393 When not installed (expected): Reference ["foo bay","whatever"] did not pass type constraint at /Users/aeruder/Projects/scratch/2020-08/test.pl line 10 "__ANON__" is a subtype of "Tuple[Enum["foo bar","foo baz"],Str]" Reference ["foo bay","whatever"] did not pass type constraint "Tuple[Enum["foo bar","foo baz"],Str]" "Tuple[Enum["foo bar","foo baz"],Str]" constrains value at index 0 of array with "Enum["foo bar","foo baz"]" "Enum["foo bar","foo baz"]" requires that the value is equal to "foo bar" or "foo baz" After doing a backtrace it appears that at some point with Type::Tiny::XS it is calling: Type::Parser::parse("Tuple[Enum[foo bar,foo baz],Str]") which is what generates the error.
I should add: this is with Type::Tiny 1.010003 and Type::Tiny::XS 0.019 and perl 5.32.0