Skip to content

Commit 53f32fd

Browse files
committed
show anonymous subsets
1 parent 10def9d commit 53f32fd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Language/typesystem.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,4 +565,15 @@ will be checked against the given code object.
565565
CATCH { default { put .^name,': ', .Str } }
566566
# OUTPUT«X::TypeCheck::Assignment: Type check failed in assignment to $i; expected Positive but got Int (-42)␤ …»
567567
568+
Subsets can be anonymous, allowing inline placements where a subset is required
569+
but a name is either needed or desireable.
570+
571+
my enum E1 <A B>;
572+
my enum E2 <C D>;
573+
sub g(@a where { .all ~~ subset :: where * ~~ E1|E2 } ) {
574+
say @a
575+
}
576+
g([A, C]);
577+
# OUTPUT«[A C]␤»
578+
568579
=end pod

0 commit comments

Comments
 (0)