You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
say $/[9999999999999999999999999999999999999999999999] gives «Nil» my @a = 1,2; say @a[9999999999999999999999999999999999999999999999] gives «(exit code 1) Cannot unbox 153 bit wide bigint into native integer in block <unit> at /tmp/ldjuzMCrIl line 1»
I have two versions of a patch for the Match variable case, one throws X::Syntax::Variable::Match (could be a different type though), the other dies with ===SORRY!=== Cannot unbox 203 bit wide bigint into native integer.
Thoughts on what's best?
The text was updated successfully, but these errors were encountered:
It's so unlikely to happen in real code that I'd just leave it to be a normal runtime error thrown by array indexing (which should be achievable by code-generating it as a normal Perl 6 integer constant, meaning a big integer will be used if needed).
If it is done at compile time, then Any ===SORRY!=== error should include a line number and file name, and it should probably better indicate the program element that was out of range.
What about EVAL? For example, can't it slip through relatively proper input validation? Something like “if X is an ascii number, and if all of the passed parameters are not bigger than half 100 bytes, then proceed”.
What about EVAL? For example, can't it slip through relatively proper input validation?
Yes, but even then, I don't think the effort of a compile-time error for it is worthwhile, so long as the runtime error (out of range value for array indexing) is decent.
say $/[9999999999999999999999999999999999999999999999]
gives«Nil»
my @a = 1,2; say @a[9999999999999999999999999999999999999999999999]
gives«(exit code 1) Cannot unbox 153 bit wide bigint into native integer in block <unit> at /tmp/ldjuzMCrIl line 1»
I have two versions of a patch for the Match variable case, one throws
X::Syntax::Variable::Match
(could be a different type though), the other dies with===SORRY!=== Cannot unbox 203 bit wide bigint into native integer
.Thoughts on what's best?
The text was updated successfully, but these errors were encountered: