X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/262309092c2de925e7ae4a527174f8dc2a0ec7b7..f99042c89715fdc05bfe40e3f190da7a47d83891:/t/lib/croak/op diff --git a/t/lib/croak/op b/t/lib/croak/op index cd3a654..002eb26 100644 --- a/t/lib/croak/op +++ b/t/lib/croak/op @@ -65,6 +65,78 @@ my main $f; EXPECT No such class field "c" in variable $f of type main at - line 3. ######## +# NAME Num-specific &= on @array +use feature 'bitwise'; +@a &= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in numeric bitwise and (&) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME Num-specific |= on @array +use feature 'bitwise'; +@a |= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in numeric bitwise or (|) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME Num-specific ^= on @array +use feature 'bitwise'; +@a ^= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in numeric bitwise xor (^) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME &.= on @array +use feature 'bitwise'; +@a &.= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in string bitwise and (&.) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME |.= on @array +use feature 'bitwise'; +@a |.= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in string bitwise or (|.) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME ^.= on @array +use feature 'bitwise'; +@a ^.= 1; +EXPECT +The bitwise feature is experimental at - line 2. +Can't modify array dereference in string bitwise xor (^.) at - line 2, near "1;" +Execution of - aborted due to compilation errors. +######## +# NAME substr %h in scalar assignment +substr(%h,0) = 3; +EXPECT +Can't modify hash dereference in substr at - line 1, near "3;" +Execution of - aborted due to compilation errors. +######## +# NAME substr %h in list assignment +(substr %h,0) = 3; +EXPECT +Can't modify hash dereference in substr at - line 1, near "3;" +Execution of - aborted due to compilation errors. +######## +# NAME vec %h in scalar assignment +vec(%h,1,1) = 3; +EXPECT +Can't modify hash dereference in vec at - line 1, near "3;" +Execution of - aborted due to compilation errors. +######## +# NAME vec %h in list assignment +(vec %h,1,1) = 3; +EXPECT +Can't modify hash dereference in vec at - line 1, near "3;" +Execution of - aborted due to compilation errors. +######## # NAME Can't declare conditional my($a?$b:$c) EXPECT @@ -80,13 +152,13 @@ Execution of - aborted due to compilation errors. # NAME ($_, state $x) = ... ($_, CORE::state $x) = (); EXPECT -Initialization of state variables in list context currently forbidden at - line 1, near ");" +Initialization of state variables in list currently forbidden at - line 1, near ");" Execution of - aborted due to compilation errors. ######## # NAME my $y; ($y, state $x) = ... my $y; ($y, CORE::state $x) = (); EXPECT -Initialization of state variables in list context currently forbidden at - line 1, near ");" +Initialization of state variables in list currently forbidden at - line 1, near ");" Execution of - aborted due to compilation errors. ######## # NAME delete BAD @@ -137,17 +209,17 @@ Execution of - aborted due to compilation errors. # NAME keys BAREWORD @a = keys FRED ; EXPECT -Type of arg 1 to keys must be hash (not constant item) at - line 1, near "FRED ;" +Type of arg 1 to keys must be hash or array (not constant item) at - line 1, near "FRED ;" Execution of - aborted due to compilation errors. ######## # NAME values BAREWORD @a = values FRED ; EXPECT -Type of arg 1 to values must be hash (not constant item) at - line 1, near "FRED ;" +Type of arg 1 to values must be hash or array (not constant item) at - line 1, near "FRED ;" Execution of - aborted due to compilation errors. ######## # NAME each BAREWORD @a = each FRED ; EXPECT -Type of arg 1 to each must be hash (not constant item) at - line 1, near "FRED ;" +Type of arg 1 to each must be hash or array (not constant item) at - line 1, near "FRED ;" Execution of - aborted due to compilation errors.