Skip to content

Commit 9eb0a16

Browse files
authored
Fix example of "To test if an object is a type object"
1 parent 2389c70 commit 9eb0a16

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/Language/typesystem.pod6

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,17 @@ type constraint may change in this case.
3636
3737
=head2 Type Objects
3838
39-
To test if an object is a type object, test for definedness and check for
40-
identity between the object and its C<.WHAT> pseudo-method. Note that the
41-
method C<.defined> can be overloaded and may provide false information.
39+
To test if an object is a type object, use L«C<.DEFINITE>|/routine/DEFINITE» method:
4240
4341
=begin code :ok-test<WHAT>
4442
my $a = Int;
45-
say so $a // $a === $a.WHAT;
43+
say not $a.DEFINITE;
4644
# OUTPUT: «True␤»
4745
=end code
4846
47+
If it returns C<True>, then the invocant is an instance. If it returns C<False>, then
48+
the invocant is a type object.
49+
4950
=head3 Undefinedness
5051
5152
Undefined objects maintain type information in Perl 6. Type objects are used to

0 commit comments

Comments
 (0)