More tests for the "Ambiguous use of ... resolved ..." warning S_scan_ident().
authorNicholas Clark <nick@ccl4.org>
Mon, 8 Apr 2013 14:27:19 +0000 (16:27 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 22 May 2013 08:31:30 +0000 (10:31 +0200)
In particular, test that the special case for reporting $# as @ works.

t/lib/warnings/toke

index 5ee3ad5..df2a0b4 100644 (file)
@@ -425,10 +425,25 @@ EXPECT
 # toke.c
 use warnings 'ambiguous' ;
 $a = ${time} ;
+$a = @{time} ;
+$a = $#{time} ; # This one is special cased in toke.c
+$a = %{time} ;
+$a = *{time} ;
+$a = defined &{time} ; # To avoid calling &::time
 no warnings 'ambiguous' ;
 $a = ${time} ;
+$a = @{time} ;
+$a = $#{time} ; # This one is special cased in toke.c
+$a = %{time} ;
+$a = *{time} ;
+$a = defined &{time} ; # To avoid calling &::time
 EXPECT
 Ambiguous use of ${time} resolved to $time at - line 3.
+Ambiguous use of @{time} resolved to @time at - line 4.
+Ambiguous use of @{time} resolved to @time at - line 5.
+Ambiguous use of %{time} resolved to %time at - line 6.
+Ambiguous use of *{time} resolved to *time at - line 7.
+Ambiguous use of &{time} resolved to &time at - line 8.
 ########
 # toke.c
 use warnings 'ambiguous' ;