This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test for lack of uninit warnings in sub redef
authorFather Chrysostomos <sprout@cpan.org>
Tue, 22 Nov 2011 06:40:41 +0000 (22:40 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 22 Nov 2011 08:07:20 +0000 (00:07 -0800)
This adds tests for something I fixed ‘by mistake’ in efcf35c4, which
occurs from 5.8.0 to 5.15.5:

$ perl5.15.4  -le '
   use warnings "uninitialized";
   use constant {u=>undef,v=>undef};
   sub foo(){u} sub foo(){v}
'
Use of uninitialized value at -e line 1.
Use of uninitialized value at -e line 1.

t/lib/warnings/9uninit

index 7d73f01..9f42689 100644 (file)
@@ -2018,3 +2018,9 @@ my $moo = $Foo::BAR + 42;
 __END__
 EXPECT
 Use of uninitialized value in addition (+) at - line 3.
+########
+use warnings 'uninitialized';
+use constant {u=>undef, v=>undef};
+sub foo () {u}
+sub foo () {v}
+EXPECT