Permalink
Browse files

Make hash(foo=>2) work

  • Loading branch information...
1 parent 4f237ff commit dadaada73c4c62d03c576591444f1c21ccc4c025 @sorear committed Jun 29, 2011
Showing with 7 additions and 1 deletion.
  1. +4 −1 lib/CORE.setting
  2. +3 −0 t/spectest.data
View
@@ -709,7 +709,10 @@ my class IterCursor {
}
sub flat(*@x) { @x }
-sub hash(\|@x) { %(@x.unwrap-single) }
+sub hash(|$cap) {
+ (%$cap || $cap.Parcel.raw_elems != 1) ??
+ %( @$cap, %$cap ) !! %( $$cap )
+}
my class Whatever {
method ACCEPTS(Mu $x) { defined(self) || $x.^isa(Whatever) }
View
@@ -59,7 +59,10 @@ S04-statement-modifiers/for.t
S04-statement-modifiers/given.t
S04-statement-modifiers/if.t
S04-statement-modifiers/unless.t
+S04-statement-modifiers/until.t
S04-statement-modifiers/values_in_bool_context.t
+S04-statement-modifiers/while.t
+S04-statement-parsing/hash.t
S04-statements/do.t
S04-statements/gather.t
S04-statements/for-scope.t

0 comments on commit dadaada

Please sign in to comment.