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
Inf not handled in Int array #4387
Comments
From liukan@360.cnhttp://irclog.perlgeek.de/perl6/2015-07-08#i_10865609 my Int @a = 1 .. Inf; Cannot coerce Inf or NaN to an Int |
From @cokeOn Wed Jul 08 05:53:44 2015, liukan@360.cn wrote:
This is related to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=61602 -- |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Wed, 08 Jul 2015 05:53:44 -0700, liukan@360.cn wrote:
Closing this, as the `@a[*-1]` mentioned in the IRC log now rightly complains about lazy lists. (Added a vaguish test for it in Raku/roast@ada48a6538 ) The fact that `my Int @a = 1..Inf;` or even `m: my Int @a = lazy 1, NaN, Int;` does not throw is not a bug. The `@` sigil is mostly-eager and it does not reify stuff that .is-lazy on assignment, so *it has no idea* some of the elements are not of the appropriate type and would need to be able to time travel to throw there and then. If you do reify the array, then throwage does happen when you reach inappropriate type: m: my Int @a = lazy 1, NaN, Int; .say for @a Lastly, some of the other errors mentioned in the IRC log aren't due to Inf in the array, but due to trying to use a non-Intifying thing as an Array index: <ZoffixW> m: [][Inf] |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#125576 (status was 'resolved')
Searchable as RT125576$
The text was updated successfully, but these errors were encountered: