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

Providing a sub signature with an invocant makes Rakudo emit an imcc syntax error #1009

Closed
p6rt opened this issue May 21, 2009 · 8 comments
Closed

Comments

@p6rt
Copy link

p6rt commented May 21, 2009

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

Searchable as RT65904$

@p6rt
Copy link
Author

p6rt commented May 21, 2009

From @masak

<masak> rakudo​: sub foo($bar​:) {};
<p6eval> rakudo 79d0b9​: OUTPUT«error​:imcc​:syntax error, unexpected
IDENTIFIER ('self') [...]
* masak submits rakudobug

Expected​: a syntax error from somewhere higher than the Parrot internals.

@p6rt
Copy link
Author

p6rt commented Jun 18, 2009

From @masak

<[particle]> rakudo​: sub postcircumfix​:<[ ]>(Str $s​: @​i) { my $res =
""; for @​i { $res ~= substr($s, $_, 1) }; $res }; say "OH HAI
WORLD"[7,0,7,2,9,4,-1]
<p6eval> rakudo 9dc941​: OUTPUT«error​:imcc​:syntax error, unexpected
IDENTIFIER ('self')␤ in file 'EVAL_24' line 102␤too many arguments
passed (2) - 1 params expected␤in sub postcircumfix​:[ ]
(/tmp/4NJRkuTmfe​:1) [...]
<[particle]> oops...
<Matt-W> I think perhaps rakudo could have a better error message there
<[particle]> it must be a method when defined with an invocant
<[particle]> yes, indeed.
<[particle]> better error messages wanted, and we'll have them when we
move to STD.pm
* Matt-W waits for masak to say he's filing a bug
* masak files rakudobug

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

From @bbkr

On Kiev build​:

$ perl6 -e 'sub foo($bar​:) {};'
$ echo $?
0

I'm not sure what is expected result.

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

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

@p6rt
Copy link
Author

p6rt commented Feb 24, 2011

From @zhuomingliang

在 2010-06-30 07​:03​:35 星期三 时,bbkr 写到:

On Kiev build​:

$ perl6 -e 'sub foo($bar​:) {};'
$ echo $?
0

I'm not sure what is expected result.

<JimmyZ_> std​: sub foo($bar​:) {};
<p6eval> std 4608239​: OUTPUT«Potential difficulties​:␤ $bar is declared
but not used at /tmp/8rhTkW7FvT line 1​:␤------> sub foo(⏏$bar​:) {};␤ok
00​:01 120m␤»

JimmyZ_> std​: sub foo($bar​:) { say $bar };
<p6eval> std 4608239​: OUTPUT«ok 00​:01 122m␤»

@p6rt
Copy link
Author

p6rt commented Feb 24, 2011

From @zhuomingliang

在 2011-02-23 20​:07​:44 星期三 时,jimmy 写到:

在 2010-06-30 07​:03​:35 星期三 时,bbkr 写到:

On Kiev build​:

$ perl6 -e 'sub foo($bar​:) {};'
$ echo $?
0

I'm not sure what is expected result.

<JimmyZ_> std​: sub foo($bar​:) {};
<p6eval> std 4608239​: OUTPUT«Potential difficulties​:␤ $bar is declared
but not used at /tmp/8rhTkW7FvT line 1​:␤------> sub foo(⏏$bar​:) {};␤ok
00​:01 120m␤»

JimmyZ_> std​: sub foo($bar​:) { say $bar };
<p6eval> std 4608239​: OUTPUT«ok 00​:01 122m␤»

<JimmyZ_> rakudo​: sub foo($bar​:) {};
<p6eval> rakudo 58e40e​: ( no output )

So I dont't think rakudo is right too, per std.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

From @moritz

It doesn't emit an IMCC syntax error anymore, but since I don't know the
expected behavior, I'm closing this ticket without tests.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

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

@p6rt p6rt closed this as completed Oct 5, 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