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 message when specifying return type before parameters ( --> Bool, Int $x, Int $y ) #4968

Closed
p6rt opened this issue Dec 31, 2015 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Dec 31, 2015

Migrated from rt.perl.org#127100 (status was 'resolved')

Searchable as RT127100$

@p6rt
Copy link
Author

p6rt commented Dec 31, 2015

From @AlexDaniel

Code​:
sub foo (--> Bool Int $x, Int $y) { True }

Result​:
===SORRY!=== Error while compiling -e
Type 'Bool' is not declared. Did you mean 'Cool'?
at -e​:1
------> sub foo (--> Bool⏏ Int $x, Int $y) { True }

I know that I'm doing it wrong, but 「Bool」 IS declared! Come on!

Actually, this is not the first time I see this, and in fact it is not the
first time I report such LTA error. See
https://rt.perl.org/Public/Bug/Display.html?id=125902

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

This was resolved in these commits​:
* rakudo/rakudo@ac97a40
* rakudo/rakudo@64b001a

「testneeded」

Please try to cover various variants in tests, like​:
(--> Bool Int $x, Int $y)
(--> Bool, Int $x, Int $y)
($x, --> Bool, Int $y)
and so on.
Maybe also test ; and ;; instead of commas, because these are also allowed as param separators.

On 2015-12-30 17​:42​:24, alex.jakimenko@​gmail.com wrote​:

Code​:
sub foo (--> Bool Int $x, Int $y) { True }

Result​:
===SORRY!=== Error while compiling -e
Type 'Bool' is not declared. Did you mean 'Cool'?
at -e​:1
------> sub foo (--> Bool⏏ Int $x, Int $y) { True }

I know that I'm doing it wrong, but 「Bool」 IS declared! Come on!

Actually, this is not the first time I see this, and in fact it is not the
first time I report such LTA error. See
https://rt.perl.org/Public/Bug/Display.html?id=125902

@p6rt
Copy link
Author

p6rt commented Feb 3, 2018

From @AlexDaniel

Tests in Raku/roast@3dab7c7

On 2017-10-07 15​:55​:27, alex.jakimenko@​gmail.com wrote​:

This was resolved in these commits​:
*
rakudo/rakudo@ac97a40
*
rakudo/rakudo@64b001a

「testneeded」

Please try to cover various variants in tests, like​:
(--> Bool Int $x, Int $y)
(--> Bool, Int $x, Int $y)
($x, --> Bool, Int $y)
and so on.
Maybe also test ; and ;; instead of commas, because these are also
allowed as
param separators.

On 2015-12-30 17​:42​:24, alex.jakimenko@​gmail.com wrote​:

Code​:
sub foo (--> Bool Int $x, Int $y) { True }

Result​:
===SORRY!=== Error while compiling -e
Type 'Bool' is not declared. Did you mean 'Cool'?
at -e​:1
------> sub foo (--> Bool⏏ Int $x, Int $y) { True }

I know that I'm doing it wrong, but 「Bool」 IS declared! Come on!

Actually, this is not the first time I see this, and in fact it is
not the
first time I report such LTA error. See
https://rt.perl.org/Public/Bug/Display.html?id=125902

@p6rt
Copy link
Author

p6rt commented Feb 3, 2018

@AlexDaniel - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Feb 3, 2018
@p6rt p6rt added LTA Less Than Awesome; typically an error message that could be better testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded
Projects
None yet
Development

No branches or pull requests

1 participant