Skip to content

Commit 19169cc

Browse files
committed
link to trait of
1 parent 3ffdc37 commit 19169cc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/Language/containers.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ maps over a list of three elements, not of one.
281281
282282
=head1 Type Constraints
283283
284-
Any container can have a type constraint in form of a L<type object|/language/typesystem#Type_objects> or a L<subset|/language/typesystem#subset>. Both can be place inbetween a declarator and the variable name or after the trait C<of>. The constraint is a property of the container, not the variable. Any (re-)binding may change the type constraint or remove the constraint altogether if bound to a value instead of a container. Introspection of type constraints on containers is provided by C<.VAR.of>.
284+
Any container can have a type constraint in form of a L<type object|/language/typesystem#Type_objects> or a L<subset|/language/typesystem#subset>. Both can be place inbetween a declarator and the variable name or after the trait L<of|/type/Variable#trait_is_dynamic>. The constraint is a property of the container, not the variable. Any (re-)binding may change the type constraint or remove the constraint altogether if bound to a value instead of a container. Introspection of type constraints on containers is provided by C<.VAR.of>.
285285
286286
EVAL ‚my $i = 42; say $i.VAR.of; $i := "forty plus two"; say $i.VAR.of;‘;
287287
CATCH { default { say .^name, ' ', .Str } }

doc/Language/variables.pod6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,9 @@ unsuccessfully, resetting the answer to 42.
844844
=head1 Type Constraints and Initialization
845845
846846
Variables have a type constraint via the L<container|/language/containers> they
847-
are bound to, which goes between the declarator and the variable name. The default type constraint is L<Mu|/type/Mu>
847+
are bound to, which goes between the declarator and the variable name. The
848+
default type constraint is L<Mu|/type/Mu>. You can also use the trait
849+
L<of|/type/Variable#trait_of> to set a type contraint.
848850
849851
my Int $x = 42;
850852
$x = 'a string';

0 commit comments

Comments
 (0)