Skip to content
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

Error on undetached range of non-Int #5447

Open
p6rt opened this issue Jul 11, 2016 · 1 comment
Open

Error on undetached range of non-Int #5447

p6rt opened this issue Jul 11, 2016 · 1 comment
Labels
LTA

Comments

@p6rt
Copy link

@p6rt p6rt commented Jul 11, 2016

Migrated from rt.perl.org#128602 (status was 'new')

Searchable as RT128602$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 11, 2016

From @zoffixznet

When an undetached method is called on a range of an Int, you get a nice message about precedence​:

BrokenRobot m​: my $x = ^5.grep​: *.is-prime # LTA
camelia rakudo-moar d075c8​: OUTPUT«Potential difficulties​:␤ Precedence of ^ is looser than method call; please parenthesize␤ at <tmp>​:1␤ ------> 3my $x = ^57⏏5.grep​: *.is-prime # LTA␤»

The message, however, isn't shown if we use infinity (a Num) for the range​:

BrokenRobot m​: my $x = ^∞.grep​: *.is-prime # LTA
camelia rakudo-moar d075c8​: OUTPUT«Method 'is-prime' not found for invocant of class 'Num'␤ in block <unit> at <tmp> line 1␤␤»

Or, it seems, any non-Int​:

BrokenRobot m​: my $x = ^5.5.grep​: *.is-prime # LTA
camelia rakudo-moar d075c8​: OUTPUT«Method 'is-prime' not found for invocant of class 'Rat'␤ in block <unit> at <tmp> line 1␤␤»

--
Cheers,
ZZ | https://twitter.com/zoffix

@p6rt p6rt added the LTA label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.