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

Pair in enum declaration should either DWIM or parsefail #5785

Closed
p6rt opened this issue Nov 7, 2016 · 7 comments
Closed

Pair in enum declaration should either DWIM or parsefail #5785

p6rt opened this issue Nov 7, 2016 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Nov 7, 2016

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

Searchable as RT130041$

@p6rt
Copy link
Author

p6rt commented Nov 7, 2016

From @FROGGS

m​: enum Foo ( A => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«43␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«1␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +A
rakudo-moar e10f76​: OUTPUT«===SORRY!=== Error while compiling
<tmp>␤Undeclared name​:␤ A used at line 1␤␤»

B should either yield 43, or the entire expression should fail to parse.
(I'd prefer the former fwiw.)

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @TimToady

This also showed up when doing things like​:
  enum Foo (<A B C> Z=> 1,2,3);

Fixed in d9021cf16e7df051c5e17c33919c9bde44c5e0db but tests needed.

On Mon, 07 Nov 2016 11​:37​:06 -0800, FROGGS.de wrote​:

m​: enum Foo ( A => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«43␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«1␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +A
rakudo-moar e10f76​: OUTPUT«===SORRY!=== Error while compiling
<tmp>␤Undeclared name​:␤ A used at line 1␤␤»

B should either yield 43, or the entire expression should fail to parse.
(I'd prefer the former fwiw.)

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @TimToady

This also showed up when doing things like​:
  enum Foo (<A B C> Z=> 1,2,3);

Fixed in d9021cf16e7df051c5e17c33919c9bde44c5e0db but tests needed.

On Mon, 07 Nov 2016 11​:37​:06 -0800, FROGGS.de wrote​:

m​: enum Foo ( A => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«43␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«1␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +A
rakudo-moar e10f76​: OUTPUT«===SORRY!=== Error while compiling
<tmp>␤Undeclared name​:␤ A used at line 1␤␤»

B should either yield 43, or the entire expression should fail to parse.
(I'd prefer the former fwiw.)

@p6rt
Copy link
Author

p6rt commented Nov 29, 2017

From @TimToady

Actually, the Z=> misbehavior is already called out in #​128017.

On Tue, 28 Nov 2017 00​:04​:05 -0800, larry wrote​:

This also showed up when doing things like​:
enum Foo (<A B C> Z=> 1,2,3);

Fixed in d9021cf16e7df051c5e17c33919c9bde44c5e0db but tests needed.

On Mon, 07 Nov 2016 11​:37​:06 -0800, FROGGS.de wrote​:

m​: enum Foo ( A => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«43␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +B
rakudo-moar e10f76​: OUTPUT«1␤»

m​: enum Foo ( 'A' => 42, 'B', 'C', 'D' ); say +A
rakudo-moar e10f76​: OUTPUT«===SORRY!=== Error while compiling
<tmp>␤Undeclared name​:␤ A used at line 1␤␤»

B should either yield 43, or the entire expression should fail to parse.
(I'd prefer the former fwiw.)

@p6rt
Copy link
Author

p6rt commented Nov 29, 2017

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

@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

From @zoffixznet

Tests​: Raku/roast@6e6eae6059

@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

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

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