Skip to content

Commit 352cd94

Browse files
committed
correct example
1 parent 3ed1803 commit 352cd94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/Language/containers.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ The constraint is a property of the container, not the variable. Any (re-)bindin
294294
type constraint or remove the constraint altogether if bound to a value instead of a container.
295295
Introspection of type constraints on containers is provided by C<.VAR.of>.
296296
297-
EVAL ‚my $i = 42; say $i.VAR.of; $i := "forty plus two"; say $i.VAR.of;‘;
297+
EVAL ‚my Int $i = 42; $i := "forty plus two";‘;
298298
CATCH { default { say .^name, ' ', .Str } }
299-
# OUTPUT: «(Mu)␤X::Method::NotFound No such method 'of' for invocant of type 'Str'␤»
299+
# OUTPUT: «Type check failed in binding; expected Int but got Str ("forty plus two")␤…»
300300
301301
302302
=head1 Custom containers
@@ -313,7 +313,7 @@ work with types in Perl 6.
313313
return Proxy.new(
314314
FETCH => method () { $c-value },
315315
STORE => method (T $new-value) {
316-
X::OutOfRange.new(what => 'number', got => '13', range => '-Inf..12, 14..Inf').throw
316+
X::OutOfRange.new(what => 'number', got => '13', range => '-..12, 14..').throw
317317
if $new-value == 13;
318318
$c-value = $new-value;
319319
}

0 commit comments

Comments
 (0)