Skip to content
Permalink
Browse files

Make bigint error on Int.chr alike (R2270)

The error from nqp contains additional information that we cannot get
at in Perl 6 atm.  Also, since nqp::char fails with an AdHoc, making
a typed exception will get us further apart.
  • Loading branch information...
lizmat committed Sep 12, 2018
1 parent d419a31 commit c8db35e32ab505b6c801192f333d8c27e4c6db0b
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/Int.pm6
@@ -72,7 +72,7 @@ my class Int does Real { # declared in BOOTSTRAP
method chr(Int:D:) {
nqp::if(
nqp::isbig_I(self),
die("chr codepoint %i (0x%X) is too large".sprintf(self, self)),
die("Error encoding UTF-8 string: could not encode codepoint %i (0x%X), codepoint out of bounds.".sprintf(self, self)),
nqp::p6box_s(nqp::chr(nqp::unbox_i(self)))
)
}

0 comments on commit c8db35e

Please sign in to comment.
You can’t perform that action at this time.