--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More tests => 4;
+
+sub Int::TYPEDSCALAR { (caller(0))[2] }
+
+{
+ use Lexical::Types;
+
+ my Int $a;
+ is $a, __LINE__-1, 'single';
+
+ my Int ($b, $c);
+ is $b, __LINE__-1, 'double (a)';
+ is $c, __LINE__-2, 'double (b)';
+
+ for my Int $d (0) {
+ is $d, 0, 'for';
+ }
+}
use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More tests => 3;
sub Str::TYPEDSCALAR {
my $buf = (caller(0))[2];
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';
-}