Skip to content

Commit

Permalink
Tweak chr out of range error output
Browse files Browse the repository at this point in the history
* This is nothing to do with UTF-8 at all, so don't mention it
* Bring it in line with the error MoarVM now gives if the codepoint is
  out of range, so we don't get an inconsistency when crossing the "big
  int to small int but still too big" line
  • Loading branch information
jnthn committed Mar 26, 2020
1 parent 101a80f commit 80dde85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.c/Int.pm6
Expand Up @@ -83,7 +83,7 @@ my class Int does Real { # declared in BOOTSTRAP
method chr(Int:D: --> Str:D) {
nqp::if(
nqp::isbig_I(self),
die("Error encoding UTF-8 string: could not encode codepoint %i (0x%X), codepoint out of bounds.".sprintf(self, self)),
die("chr codepoint %i (0x%X) is out of bounds".sprintf(self, self)),
nqp::p6box_s(nqp::chr(nqp::unbox_i(self)))
)
}
Expand Down

0 comments on commit 80dde85

Please sign in to comment.