Last active
May 28, 2016 12:06
-
-
Save dogbert17/447575b42b268b3d562a020bb754fadd to your computer and use it in GitHub Desktop.
Attempt to document method keyof in class Hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method keyof | |
Defined as: | |
method keyof | |
Usage: | |
Hash.keyof | |
Returns the type constraint for the keys of the invocant. For | |
normal hashes the method returns the coercion type C<(Str(Any))> | |
while for L<object hashes|/type/Hash#Object_hashes_and_type_constraints> | |
the type used in the declaration of the C<Hash> is returned. | |
my %h1 = 'apples' => 3, 'oranges' => 7; # (no key type specified) | |
say %h1.keyof; # (Str(Any)) | |
my %h2{Str} = 'oranges' => 7; # (keys must be of type C<Str>) | |
say %h2.keyof; # (Str) |
Fixed, that part was from yesterday, before you and jnthn worked your magic :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
say %h1.keyof; # (Any) # Str(Any) ??