use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More tests => 7;
sub Str::TYPEDSCALAR {
my $buf = (caller(0))[2];
()
}
-use Lexical::Types;
+{
+ use Lexical::Types;
-my Str $x;
-our $r = <$x>;
-is $r, __LINE__-2, 'trick for our - readline';
+ my Str $x;
+ our $r = <$x>;
+ is $r, __LINE__-2, 'trick for our - readline';
-my Str $y;
-my $s = <$y>;
-is $s, __LINE__-2, 'trick for my - readline';
+ my Str $y;
+ my $s = <$y>;
+ is $s, __LINE__-2, 'trick for my - readline';
-my $z = 7;
-is $z, 7, 'trick for others';
+ my $z = 7;
+ is $z, 7, 'trick for others';
+}
+
+my $count;
+sub Int::TYPEDSCALAR { return ++$count }
+
+{ package INT; }
+
+{
+ use Lexical::Types as => sub { $_[0] eq 'Int' ? @_ : () };
+
+ my Int ($x, $y);
+ is $x, 1, 'successive padany 1';
+ is $y, 2, 'successive padany 2';
+
+ my INT ($z, $t);
+ is $z, undef, 'successive padany 3';
+ is $t, undef, 'successive padany 4';
+}