Skip to content

Commit b156ee6

Browse files
committed
Add missing X:: docs
1 parent 0c3c625 commit b156ee6

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
=begin pod :kind("Type") :subkind("class") :category("exception")
2+
3+
=TITLE class X::Numeric::CannotConvert
4+
5+
=SUBTITLE Error while trying to coerce a number to another type
6+
7+
class X::Numeric::CannotConvert is Exception { }
8+
9+
Occurs when an attempt to coerce a L<C<Inf>|/type/Num#Inf> or
10+
a L<C<NaN>|/type/Num#NaN> to a L<C<Numeric>|/type/Numeric> type.
11+
12+
13+
For example
14+
15+
say Inf.Int;
16+
CATCH { default { put .^name, ': ', .Str } };
17+
# OUTPUT: «X::Numeric::CannotConvert: Cannot convert Inf to Int␤»
18+
19+
Most other conversion errors throw L<C<X::Numeric::Real>|/type/X::Numeric::Real>.
20+
21+
=head1 Methods
22+
23+
=head2 method source
24+
25+
method source()
26+
27+
Returns the value that failed to coerce.
28+
29+
=head2 method target
30+
31+
method target()
32+
33+
Returns the type to which the coercion was attempted.
34+
35+
=head2 method reason
36+
37+
method reason(--> Str:D)
38+
39+
Returns the reason that the conversion failed.
40+
41+
=end pod

0 commit comments

Comments
 (0)