Skip to content

Commit d7abc10

Browse files
authored
Clarify Any.list
Even though Any.list returns a List, clarify that subclasses can return any Positional for this method.
1 parent 3254d02 commit d7abc10

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/Type/Any.pod6

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ L<none>-L<Junction> from it.
8484
8585
Defined as:
8686
87-
multi method list(Any:U: -->List)
88-
multi method list(Any:D \SELF: -->List)
87+
multi method list(Any:U: --> List)
88+
multi method list(Any:D \SELF: --> List)
8989
9090
9191
Applies the infix L«C<,>|/routine/,»
@@ -95,6 +95,10 @@ and returns the resulting L<List>:
9595
say 42.list.^name; # OUTPUT: «List␤»
9696
say 42.list.elems; # OUTPUT: «1␤»
9797
98+
Subclasses of C<Any> may choose to return any L<Positional> type
99+
from L«C<.list>|/routine/list>. Use L«C<.List>|/routine/List> to
100+
coerce specifically to L<List>.
101+
98102
=head2 method push
99103
100104
Defined as:

0 commit comments

Comments
 (0)