Call to `tie` does not initialize variable as documented
m-dango opened this issue · 1 comments
m-dango commented
There are places in the documentation where Perl's tie
is used to initialize a variable. However, the args given after the type look to be dropped. I'm not sure if this is a documentation error or a bug.
https://replit.com/@m-dango/TypeTiny-tie#main.pl
Line 344 in 48a4d53
tobyink commented
This is a bug. It works when you use Type::Tie's ttie
wrapper, but not when you directly tie a variable to a type. Should be fixed in the next release.
Further, from the next release, this should work:
tie my $x, Int;
say $x; # 0, not undef, because undef isn't an integer!