Skip to content

Commit d45c780

Browse files
k3ut0iJJ
authored andcommitted
default base type for subset declaration
1 parent cceeca5 commit d45c780

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/Language/typesystem.pod6

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,11 @@ Subsets can be used in signatures, e.g. by typing the output:
911911
a(1, "foo"); # passes
912912
a("foo", 1); # fails
913913
914+
If you skip the base type, it defaults to C<Any>. So the following two are equivalent:
915+
916+
subset A-or-B where * ~~ A | B
917+
subset A-or-B of Any where * ~~ A | B
918+
914919
Subsets can be anonymous, allowing inline placements where a subset is required
915920
but a name is neither needed nor desirable.
916921

0 commit comments

Comments
 (0)