Skip to content

Commit

Permalink
Update Parameter.rakudoc
Browse files Browse the repository at this point in the history
In the edited example, I see no way how the ::U type capture can be different from the ::T one. So it appears that the possibility of having more than one type capture per argument is useless. If an explanation can be provided, I will gladly edit it back in, with the explanation.
  • Loading branch information
lucs committed Apr 3, 2023
1 parent 3477c60 commit 1c86a73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Type/Parameter.rakudoc
Expand Up @@ -282,9 +282,9 @@ Returns a list of variable names of L<type captures|/language/signatures#Type_ca
parameter. Type captures define a type name within the attached code,
which is an alias to the type gleaned from the argument during a call.

sub a(::T ::U $x) { T.say }
sub a(::T $x) { T.say }
a(8); # OUTPUT: «(Int)␤»
say &a.signature.params[0].type_captures; # OUTPUT: «(T U)␤»
say &a.signature.params[0].type_captures; # OUTPUT: «(T)␤»
sub b($x) { $x.^name.say }
a(8); # OUTPUT: «Int␤»

Expand Down

0 comments on commit 1c86a73

Please sign in to comment.