I am expecting both tests to pass. Unfortunately the empty string test is failing.
use Test::More tests => 2;
use Type::Tie qw( ttie );
use Types::Standard qw( Num Str );
ttie my @n, Num;
is_deeply \@n, [], 'empty list';
ttie my $s, Str;
is $s, '', 'empty string';
From my perspective, a proper initial value ("zero" value in golang terminology) should be assigned to an undefined scalar variable. The value has to honour the type constraint. Maybe Type::Tie::SCALAR::_DEFAULT has to depend on the type constraint.
I am expecting both tests to pass. Unfortunately the
empty string
test is failing.From my perspective, a proper initial value ("zero" value in golang terminology) should be assigned to an undefined scalar variable. The value has to honour the type constraint. Maybe Type::Tie::SCALAR::_DEFAULT has to depend on the type constraint.