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

Suggest multi in "redeclaration of sub foo" error #3175

Closed
p6rt opened this issue Jun 23, 2013 · 6 comments
Closed

Suggest multi in "redeclaration of sub foo" error #3175

p6rt opened this issue Jun 23, 2013 · 6 comments
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Jun 23, 2013

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

Searchable as RT118607$

@p6rt
Copy link
Author

p6rt commented Jun 23, 2013

From perlbug@ayiko.be

use v6;
sub foo() { say 'hi'; };
sub foo($i) { say "hi $i"; };
foo();

Gives as error
===SORRY!===
Redeclaration of routine foo
at test2.pl​:3
------> sub foo($i) { say "hi 2"; }<HERE>;
  expecting any of​:
  postfix
  statement end
  statement modifier
  statement modifier loop
  horizontal whitespace

Maybe it should mention "multi sub" as a possible fix?

I'm also not sure the "expecting any of" part is helping much in this case...

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

From @zoffixznet

Fixed in rakudo/rakudo@5dba970

Testsneeded (which I spot are being prepared in a fork​: MasterDuke17/roast@44779ac )

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

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

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

From @MasterDuke17

On Sun Jun 23 04​:26​:36 2013, Ayiko wrote​:

use v6;
sub foo() { say 'hi'; };
sub foo($i) { say "hi $i"; };
foo();

Gives as error
===SORRY!===
Redeclaration of routine foo
at test2.pl​:3
------> sub foo($i) { say "hi 2"; }<HERE>;
expecting any of​:
postfix
statement end
statement modifier
statement modifier loop
horizontal whitespace

Maybe it should mention "multi sub" as a possible fix?

I'm also not sure the "expecting any of" part is helping much in this
case...

Implemented in Rakudo PR 854 (rakudo/rakudo#854).
Tests added in roast PR 148 (Raku/roast#148).

@p6rt
Copy link
Author

p6rt commented Aug 31, 2016

From @coke

On Tue Aug 30 10​:07​:57 2016, ddgreen@​gmail.com wrote​:

On Sun Jun 23 04​:26​:36 2013, Ayiko wrote​:

use v6;
sub foo() { say 'hi'; };
sub foo($i) { say "hi $i"; };
foo();

Gives as error
===SORRY!===
Redeclaration of routine foo
at test2.pl​:3
------> sub foo($i) { say "hi 2"; }<HERE>;
expecting any of​:
postfix
statement end
statement modifier
statement modifier loop
horizontal whitespace

Maybe it should mention "multi sub" as a possible fix?

I'm also not sure the "expecting any of" part is helping much in this
case...

Implemented in Rakudo PR 854 (rakudo/rakudo#854).
Tests added in roast PR 148 (Raku/roast#148).

Looks like both of these were merged. Closing ticket.
--
Will "Coke" Coleda

@p6rt p6rt closed this as completed Sep 2, 2016
@p6rt
Copy link
Author

p6rt commented Sep 2, 2016

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

@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