New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove P6opauqe
from unboxing errors
#4371
Comments
From @drforrnum64 should be a floating-point type as per the docs, so $value = 1.0 --cut here-- throws this error instead: --cut here-- --cut here-- |
From @AlexDanielRight, because it's a Rat. sub foo(num64 $scale = 1.0) {}; say foo # This type cannot unbox to a native number: P6opaque, Rat I don't know what is the consensus on this one, but having to .Num your values is rather reasonable. The error message is LTA though. On 2015-07-01 12:44:09, drforr@pobox.com wrote:
|
The RT System itself - Status changed from 'new' to 'open' |
From @jnthnOn Mon, 02 Oct 2017 18:09:45 -0700, alex.jakimenko@gmail.com wrote:
No need for .Num, just write it as 1e0 so it's a Num literal.
The rule is simple: types in Perl 6 are constraints. We do go as far as letting literals play the role of both a native and a boxed (int/Int, num/Num), but no further.
What would you like it to say? It seems to contain all relevant information we can reasonably provide in a runtime error (what we tried to unbox it to, and what type it was); the mention of P6opauqe could go away, though, as it doesn't really add anything. |
Migrated from rt.perl.org#125523 (status was 'open')
Searchable as RT125523$
The text was updated successfully, but these errors were encountered: