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

quoted LHS of pair constructor inside enum definition makes elements be ignored #3546

Closed
p6rt opened this issue Oct 8, 2014 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Oct 8, 2014

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

Searchable as RT122929$

@p6rt
Copy link
Author

p6rt commented Oct 8, 2014

From @timo

compare​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say +A; say +B;'
1
2

and​:

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say +A; say +B;'
0
1

and see also​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say foo'
===SORRY!=== Error while compiling -e
Undeclared routine​:
foo used at line 1

vs

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say foo'
foo

I think this should at least warn or die, not silently drop an element
from the list.

This bit me in my Cairo binding, as it requires an enum to start at -1
and i accidentally quoted the LHS of the initial pair.

@p6rt
Copy link
Author

p6rt commented Nov 29, 2017

From @TimToady

Fixed in 754664ed54aea24f9c9162002b6e68aadd311412.

On Wed, 08 Oct 2014 05​:20​:07 -0700, timo wrote​:

compare​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say +A; say +B;'
1
2

and​:

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say +A; say +B;'
0
1

and see also​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say foo'
===SORRY!=== Error while compiling -e
Undeclared routine​:
foo used at line 1

vs

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say foo'
foo

I think this should at least warn or die, not silently drop an element
from the list.

This bit me in my Cairo binding, as it requires an enum to start at -1
and i accidentally quoted the LHS of the initial pair.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 29, 2017

From @TimToady

Fixed in 754664ed54aea24f9c9162002b6e68aadd311412.

On Wed, 08 Oct 2014 05​:20​:07 -0700, timo wrote​:

compare​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say +A; say +B;'
1
2

and​:

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say +A; say +B;'
0
1

and see also​:

perl6-m -e 'enum Bug ("foo" => -1, "A", "B"); say foo'
===SORRY!=== Error while compiling -e
Undeclared routine​:
foo used at line 1

vs

perl6-m -e 'enum Bug (foo => -1, "A", "B"); say foo'
foo

I think this should at least warn or die, not silently drop an element
from the list.

This bit me in my Cairo binding, as it requires an enum to start at -1
and i accidentally quoted the LHS of the initial pair.

@p6rt
Copy link
Author

p6rt commented Feb 4, 2018

From @zoffixznet

Tests Raku/roast@f020377c78

@p6rt
Copy link
Author

p6rt commented Feb 4, 2018

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

@p6rt p6rt closed this as completed Feb 4, 2018
@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