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

Mixing pairs and <> lists in the enum declaration gives a weird error in Rakudo #2905

Closed
p6rt opened this issue Sep 26, 2012 · 6 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 26, 2012

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

Searchable as RT115052$

@p6rt
Copy link
Author

p6rt commented Sep 26, 2012

From @masak

<moritz> r​: enum A (b => 42, <c d e>); say A.enums.perl
<p6eval> rakudo 16f22b​: OUTPUT«===SORRY!===␤Method 'returns' not found
for invocant of class 'Parcel'␤»
<moritz> rakudobug
<masak> looks like something that oughta work.
<sorear> masak​: and it clearly should not fail like that
* masak submits
<sorear> masak​: I think it's trying to treat a parcel as QAST node
<moritz> I think I know how to fix it, though jnthn might not like the
fix. sorear will though :-)
<masak> moritz​: you have too much knowledge of the internals of our
implementors :P
* sorear is curious :-)
<sorear> theoretically you should be able to do enum A < :b<42> c d e >
<moritz> masak​: the fix is to call $*W.compile_time_evaluate on the
expression, instead of trying to obtain the return values from the AST
<moritz> instead of doing some kind of half-baked constant folding, as we do now
<masak> moritz​: sounds sane to me.
<moritz> but last time I did that for some values, jnthn didn't like
the approach
<moritz> whereas sorear uses it in niecza for a variety of cases already
<moritz> so, that's what my quasi-cryptic statement was about :-)
<masak> all noted in the rakudobug ;)

@p6rt
Copy link
Author

p6rt commented Jan 13, 2015

From @usev6

The weird error does no longer occur​:

$ perl6-m -e 'enum A (b => 42, <c d e>); say A.enums.perl'
("b" => 42, "c d e" => 43).hash

Is that the expected result? (There is ticket https://rt-archive.perl.org/perl6/Ticket/Display.html?id=123191 complaining about this behaviour.)

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 13, 2015

From @usev6

The weird error does no longer occur​:

$ perl6-m -e 'enum A (b => 42, <c d e>); say A.enums.perl'
("b" => 42, "c d e" => 43).hash

Is that the expected result? (There is ticket https://rt-archive.perl.org/perl6/Ticket/Display.html?id=123191 complaining about this behaviour.)

@p6rt
Copy link
Author

p6rt commented Jan 13, 2015

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

@p6rt p6rt closed this as completed Aug 28, 2015
@p6rt
Copy link
Author

p6rt commented Aug 28, 2015

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

@p6rt
Copy link
Author

p6rt commented Aug 28, 2015

From @coke

On Tue Jan 13 14​:12​:00 2015, bartolin@​gmx.de wrote​:

The weird error does no longer occur​:

$ perl6-m -e 'enum A (b => 42, <c d e>); say A.enums.perl'
("b" => 42, "c d e" => 43).hash

Is that the expected result? (There is ticket
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=123191 complaining about
this behaviour.)

So, the weird error is gone, and the other ticket is asking for the right behavior - closing this ticket.
--
Will "Coke" Coleda

@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