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

Internal error message on Z=> in enum declaration in Rakudo #3049

Closed
p6rt opened this issue Feb 11, 2013 · 6 comments
Closed

Internal error message on Z=> in enum declaration in Rakudo #3049

p6rt opened this issue Feb 11, 2013 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 11, 2013

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

Searchable as RT116719$

@p6rt
Copy link
Author

p6rt commented Feb 11, 2013

From @masak

<TimToady> r​: enum Color (<red green purple> Z=> 1,2,4);
<p6eval> rakudo a3869a​: OUTPUT«===SORRY!===␤Method 'returns' not found
for invocant of class 'List'␤»
<TimToady> masak​: ^^
* masak submits TimToady's rakudobug
<masak> r​: say (<red green purple> Z=> 1,2,4).perl
<p6eval> rakudo a3869a​: OUTPUT«("red" => 1, "green" => 2, "purple" => 4).list␤»

@p6rt
Copy link
Author

p6rt commented Jan 6, 2015

From @usev6

This command no longer results in an internal error message. But the resulting enum is not what I expected in the first place (but maybe it's technically correct)​:

$ perl6 -e 'enum Color (<red green purple> Z=> 1,2,4); say Color.enums'
"red\t1 green\t2 purple\t4" => 0

I get the same result when I add an extra pair of parens around a list of pairs​:

$ perl6 -e 'enum Color (red => 1, green => 2, purple => 4); say Color.enums'
"green" => 2, "purple" => 4, "red" => 1

$ perl6 -e 'enum Color ((red => 1, green => 2, purple => 4)); say Color.enums'
"red\t1 green\t2 purple\t4" => 0

But I cannot just remove the parens in the first example since, since that seems to execute 'enum Color <red green purple' and zip the resulting enum with (1, 2, 4)​:

$ perl6 -e 'say enum Color <red green purple> Z=> 1,2,4; say Color.enums'
Color => 1
"green" => 1, "purple" => 2, "red" => 0

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 6, 2015

From @usev6

This command no longer results in an internal error message. But the resulting enum is not what I expected in the first place (but maybe it's technically correct)​:

$ perl6 -e 'enum Color (<red green purple> Z=> 1,2,4); say Color.enums'
"red\t1 green\t2 purple\t4" => 0

I get the same result when I add an extra pair of parens around a list of pairs​:

$ perl6 -e 'enum Color (red => 1, green => 2, purple => 4); say Color.enums'
"green" => 2, "purple" => 4, "red" => 1

$ perl6 -e 'enum Color ((red => 1, green => 2, purple => 4)); say Color.enums'
"red\t1 green\t2 purple\t4" => 0

But I cannot just remove the parens in the first example since, since that seems to execute 'enum Color <red green purple' and zip the resulting enum with (1, 2, 4)​:

$ perl6 -e 'say enum Color <red green purple> Z=> 1,2,4; say Color.enums'
Color => 1
"green" => 1, "purple" => 2, "red" => 0

@p6rt
Copy link
Author

p6rt commented Jan 6, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 1, 2017

From @AlexDaniel

Yeah, this is not correct, and it was resolved in (2017-11-27) rakudo/rakudo@d9021cf

Now you may wonder when the original “Method 'returns' not found” was fixed, and… that was on Parrot :) So not really bisectable and not even relevant today.

W4anD0eR96++ wrote a test for it in Raku/roast@1fbabe9

Closing.

On 2015-01-06 13​:51​:00, bartolin@​gmx.de wrote​:

This command no longer results in an internal error message. But the
resulting enum is not what I expected in the first place (but maybe
it's technically correct)​:

$ perl6 -e 'enum Color (<red green purple> Z=> 1,2,4); say
Color.enums'
"red\t1 green\t2 purple\t4" => 0

I get the same result when I add an extra pair of parens around a list
of pairs​:

$ perl6 -e 'enum Color (red => 1, green => 2, purple => 4); say
Color.enums'
"green" => 2, "purple" => 4, "red" => 1

$ perl6 -e 'enum Color ((red => 1, green => 2, purple => 4)); say
Color.enums'
"red\t1 green\t2 purple\t4" => 0

But I cannot just remove the parens in the first example since, since
that seems to execute 'enum Color <red green purple' and zip the
resulting enum with (1, 2, 4)​:

$ perl6 -e 'say enum Color <red green purple> Z=> 1,2,4; say
Color.enums'
Color => 1
"green" => 1, "purple" => 2, "red" => 0

@p6rt
Copy link
Author

p6rt commented Dec 1, 2017

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

@p6rt p6rt closed this as completed Dec 1, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant