Skip to content

Commit 8e000ca

Browse files
authored
Document Signature.ACCEPTS can't see into where clauses
1 parent 0c5ab85 commit 8e000ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Type/Signature.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,13 @@ and follows the same semantics as L<Capture> C<$topic>:
796796
42 ~~ :(Int); # RESULT: «False» (Int.Capture throws)
797797
set(<a b>) ~~ :(:$a, :$b); # RESULT: «True»
798798
799+
Since L«C<where> clauses|/type/Signature#index-entry-where_clause_(Signature)»
800+
are not introspectable, the method cannot determine whether one signature
801+
L<ACCEPTS> the same sort of C<where>-constrained parameter. Such such comparisons
802+
will return C<False>. This includes signatures with literals, which are just
803+
sugar for the C<where>-constraints:
804+
805+
say :(42) ~~ :($ where 42) # OUTPUT: «False␤»
799806
800807
=head2 method Capture
801808

0 commit comments

Comments
 (0)