Skip to content

Commit b794a73

Browse files
authored
Fix default default for optional params
Blocks actually default to Mu not Any
1 parent 3796780 commit b794a73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/Type/Signature.pod6

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,11 @@ objects and discovering them with the C<.DEFINITE> method.
278278
279279
Keep in mind all parameters have values; even optional ones have
280280
default defaults that are the type object of the constrained type
281-
for explicit type constraints or an L<Any> type object if no
282-
explicit type constraint exists. This means that if you use the
283-
C<:D> type smiley, you'd need to provide a default value or make
284-
the parameter required. Otherwise, the default default would be
281+
for explicit type constraints. If no explicit type constraint exists,
282+
the default default is an L<Any> type object for methods, submethods,
283+
and subroutines, and a L<Mu> type object for blocks. This means that
284+
if you use the C<:D> type smiley, you'd need to provide a default
285+
value or make the parameter required. Otherwise, the default default would be
285286
a type object, which would fail the definiteness constraint.
286287
287288
sub divide (Int:D :$a = 2, Int:D :$b!) { say $a/$b }

0 commit comments

Comments
 (0)