File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -286,13 +286,14 @@ a L<Signature> literal right after the parameter (no whitespace allowed):
286
286
f(&g);
287
287
# OUTPUT: «ten10»
288
288
289
- This shorthand syntax is available only for parameters with the `&` sigil. For
289
+ This shorthand syntax is available only for parameters with the C < & > sigil. For
290
290
others, you need to use the long version:
291
291
292
- sub f($c: where .signature ~~ :(Int, Str)) { say $c(10, 'ten') };
293
- sub g(Num $i, Str $s) { $s ~ $i };
294
- f(&g);
295
- # OUTPUT: «ten10»
292
+ sub f($c where .signature ~~ :(Int, Str)) { say $c(10, 'ten') }
293
+ sub g(Num $i, Str $s) { $s ~ $i }
294
+ sub h(Int $i, Str $s) { $s ~ $i }
295
+ # f(&g); # Constraint type check failed
296
+ f(&h); # OUTPUT: «ten10»
296
297
297
298
= head3 X « Constraining Return Types|-->;returns »
298
299
You can’t perform that action at this time.
0 commit comments