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

Bad error message when user mistyped "returns" to "return" in *fix signatures #6052

Closed
p6rt opened this issue Feb 3, 2017 · 5 comments
Closed
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Feb 3, 2017

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

Searchable as RT130712$

@p6rt
Copy link
Author

p6rt commented Feb 3, 2017

From alexander.kiryuhin@gmail.com

m​: sub infix​:<$>($x, $y) return Nil {}
Cannot find method 'has_compile_time_value' on object of type NQPMu
  in any routine_declarator​:sym<sub> at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
  in any routine_declarator at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
  in any term​:sym<routine_declarator> at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
  in any term at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1

m​: sub infix​:<$>($x, $y) returns Nil {}
sub infix​:<$> ($x, $y --> Nil) {
#`(Sub+{Precedence}+{Callable[Nil]}|52646672) ... }

It doesn't give you location where the error occurs, which is LTA. Error
message with "Are you typed 'return' instead or 'returns'" suggestion would
be much better. It occurs for postfix too and I suspect it it is true for
every *fix-like operator signature.

--
--
Alexander.

@p6rt
Copy link
Author

p6rt commented Feb 4, 2017

From @AlexDaniel

Fixed in rakudo/rakudo@acae345

Tests needed.

On 2017-02-03 10​:41​:34, alexander.kiryuhin@​gmail.com wrote​:

m​: sub infix​:<$>($x, $y) return Nil {}
Cannot find method 'has_compile_time_value' on object of type NQPMu
in any routine_declarator​:sym<sub> at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
in any routine_declarator at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
in any term​:sym<routine_declarator> at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1
in any term at
/home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm
line 1

m​: sub infix​:<$>($x, $y) returns Nil {}
sub infix​:<$> ($x, $y --> Nil) {
#`(Sub+{Precedence}+{Callable[Nil]}|52646672) ... }

It doesn't give you location where the error occurs, which is LTA. Error
message with "Are you typed 'return' instead or 'returns'" suggestion would
be much better. It occurs for postfix too and I suspect it it is true for
every *fix-like operator signature.

@p6rt
Copy link
Author

p6rt commented Feb 4, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 28, 2017

From @zoffixznet

Tests in rakudo/rakudo@664f767

@p6rt
Copy link
Author

p6rt commented Feb 28, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Feb 28, 2017
@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