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

"sub foo;" tries to call foo instead of giving parse error #2387

Closed
p6rt opened this issue Mar 10, 2011 · 6 comments
Closed

"sub foo;" tries to call foo instead of giving parse error #2387

p6rt opened this issue Mar 10, 2011 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Mar 10, 2011

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

Searchable as RT85844$

@p6rt
Copy link
Author

p6rt commented Mar 10, 2011

From @bbkr

[16​:12] <bbkr_> rakudo​: sub foo; # looks bad, this should be parse error, not
attempt to call foo.
[16​:12] <p6eval> rakudo a38d45​: OUTPUT«Could not find sub &fooâ�¤ in main
program body at line 22​:/tmp/c10WrR9Dodâ�¤Â»
[16​:12] <moritz_> bbkr_​: long known
[16​:12] <jnthn> std​: sub foo;
[16​:12] <p6eval> std 4608239​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0mâ�¤Malformed
block at /tmp/89UskaNhFr line 1​:â�¤------> �[32msub foo�[33mâ���[31m;�[0mâ�¤
expecting any of​:â�¤ new name to be definedâ�¤ routine_defâ�¤ traitâ�¤Parse
failedâ�¤FAILED 00​:01 117mâ�¤Â»
[16​:13] <moritz_> bbkr_​: oh wait, I misparsed :-)
[16​:13] <moritz_> std​: sub(foo())
[16​:13] <p6eval> std 4608239​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0mâ�¤Undeclared
routines​:â�¤ 'foo' used at line 1â�¤ 'sub' used at line 1â�¤Check
failedâ�¤FAILED 00​:01 118mâ�¤Â»
[16​:18] <bbkr_> so it is bug or not? I don't understand the difference
between "sub foo" and sub(foo()) in STD.
[16​:18] <moritz_> the parenthesis :-)
[16​:18] <moritz_> yes, bug
[16​:19] --> hanekomu has joined this channel
(~hanekomu@​2001​:62a​:4​:203​:cabc​:c8ff​:fea1​:8046).
[16​:19] <bbkr_> in STD (because parenthesized syntax behaves differently) or
in rakudo?
[16​:21] <moritz_> rakudo has the bug
[16​:21] * bbkr_ reports, thanks

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Thu Mar 10 07​:23​:08 2011, pawel.pabian@​implix.com wrote​:

[16​:12] <bbkr_> rakudo​: sub foo; # looks bad, this should be parse
error, not
attempt to call foo.
[16​:12] <p6eval> rakudo a38d45​: OUTPUT«Could not find sub &fooâ�¤ in
main
program body at line 22​:/tmp/c10WrR9Dodâ�¤Â»

Fixed​:

17​:22 < [Coke]> rakudo​: sub foo;
17​:22 <+p6eval> rakudo 33f1cf​: OUTPUT«===SORRY!===â�¤Missing block at
line 1,
  near ";"â�¤Â»

Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

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

@p6rt
Copy link
Author

p6rt commented Nov 15, 2011

From @tadzik

Tests in 681e1e4, closable

@p6rt
Copy link
Author

p6rt commented Nov 15, 2011

From @masak

On Tue Nov 15 08​:39​:43 2011, tadzik wrote​:

Tests in 681e1e4, closable

Thanks; resolved.

@p6rt
Copy link
Author

p6rt commented Nov 15, 2011

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

@p6rt p6rt closed this as completed Nov 15, 2011
@p6rt p6rt added the testneeded 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
Development

No branches or pull requests

1 participant