This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #46947] Parse method-BLOCK arguments as a term
[perl5.git] / t / comp / parser.t
index 7caa116..c5cff29 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
     chdir 't';
 }
 
-print "1..169\n";
+print "1..170\n";
 
 sub failed {
     my ($got, $expected, $name) = @_;
@@ -499,6 +499,10 @@ eval 'for my a1b $i (1) {}';
 # ng: 'Missing $ on loop variable'
 like $@, "^No such class a1b at ", 'TYPE of my of for statement';
 
+eval 'method {} {$_,undef}';
+like $@, qq/^Can't call method "method" on unblessed reference at /,
+     'method BLOCK {...} does not try to disambiguate';
+
 # Add new tests HERE (above this line)
 
 # bug #74022: Loop on characters in \p{OtherIDContinue}