We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6da455 commit 0efcb72Copy full SHA for 0efcb72
doc/Type/Str.pod6
@@ -1132,6 +1132,18 @@ they will not be converted to a number by C<val>, by design.
1132
See L«unival|/routine/unival» if you need to convert such characters to
1133
C<Numeric>.
1134
1135
+=head2 method Version
1136
+
1137
+ method Version(Str:D: --> Version:D)
1138
1139
+Coerces the string to L<Version|/type/Version>.
1140
1141
+This could be used for L<type coercion in
1142
+signature|/type/Signature#Coercion_type>, as for example:
1143
1144
+ sub f(Version(Str) $want-version) { say $want-version.^name };
1145
+ f "1.2.3"; # OUTPUT: «Version»
1146
1147
=end pod
1148
1149
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
0 commit comments