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

Defining two different enumerations with the same enum value should result in ambiguity in Rakudo; doesn't #1492

Closed
p6rt opened this issue Feb 10, 2010 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 10, 2010

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

Searchable as RT72696$

@p6rt
Copy link
Author

p6rt commented Feb 10, 2010

From @masak

<masak> rakudo​: enum A <a b c>; enum B <a b c>; say &a.perl
<p6eval> rakudo 1d4928​: OUTPUT«B​::a␤»
* masak submits rakudobug
<jnthn> ?
<jnthn> Heh
<moritz_> it should be ambiguous
<jnthn> Oh
<moritz_> I can never remember how to write that word :-)
<jnthn> Yeah, that.

According to S12​:1787, rather than just picking B​::a, &a should be
unavailable as a symbol, due to it being found both in A and in B.

@p6rt
Copy link
Author

p6rt commented May 27, 2010

From nastavs@gmail.com

Here's something more along the same lines.

<isBEKaml> rakudo​: enum One <a b c d e>; enum Two <a b c d e>; say &d;
<p6eval> rakudo 982e8e​: OUTPUT«Contextual $*PKGDECL not found␤current
instr.​: 'perl6;Perl6;Grammar;add_my_name' pc 44311
(src/gen/perl6-grammar.pir​:79)␤»

for sure, it's a LTA error message.

Regards,

Shrivatsan

@p6rt
Copy link
Author

p6rt commented May 27, 2010

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

@p6rt
Copy link
Author

p6rt commented May 27, 2010

From nastavs@gmail.com

On Thu May 27 01​:19​:33 2010, svatsan wrote​:

Here's something more along the same lines.

<isBEKaml> rakudo​: enum One <a b c d e>; enum Two <a b c d e>; say &d;
<p6eval> rakudo 982e8e​: OUTPUT«Contextual $*PKGDECL not found␤current
instr.​: 'perl6;Perl6;Grammar;add_my_name' pc 44311
(src/gen/perl6-grammar.pir​:79)␤»

<isBEKaml> rakudo​: enum One <a b c d e>; say One​::d.WHAT.perl; enum Two
<a b c d e>; Two​::d.WHAT.perl.say;
<p6eval> rakudo 982e8e​: OUTPUT«Contextual $*PKGDECL not found␤current
instr.​: 'perl6;Perl6;Grammar;add_my_name' pc 44311
(src/gen/perl6-grammar.pir​:79)␤»

@p6rt
Copy link
Author

p6rt commented Oct 14, 2011

From @coke

Current status​: mostly the same, looks like the leading & is no longer
required​:

15​:19 < [Coke]> rakudo​: enum A <a b c>; enum B <a b c>; say &a.perl
15​:19 <+p6eval> rakudo ce15be​: OUTPUT«===SORRY!===␤Symbol '&a' not
predeclared
  in <anonymous> (/tmp/JQVXYcGEKu​:1)␤»
15​:22 < [Coke]> rakudo​: enum A <a b c>; enum B <a b c>; say c.perl
15​:22 <+p6eval> rakudo ce15be​: OUTPUT«B​::c␤»

--
Will "Coke" Coleda

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 14, 2011

From @coke

Current status​: mostly the same, looks like the leading & is no longer
required​:

15​:19 < [Coke]> rakudo​: enum A <a b c>; enum B <a b c>; say &a.perl
15​:19 <+p6eval> rakudo ce15be​: OUTPUT«===SORRY!===␤Symbol '&a' not
predeclared
  in <anonymous> (/tmp/JQVXYcGEKu​:1)␤»
15​:22 < [Coke]> rakudo​: enum A <a b c>; enum B <a b c>; say c.perl
15​:22 <+p6eval> rakudo ce15be​: OUTPUT«B​::c␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @bbkr

2012.10 - still broken (should fail on redeclaration)

<bbkr_> rakudo​: enum A <a b c>; enum B <a b c>; say c.perl
<p6eval> rakudo c82d10​: OUTPUT«B​::c␤»

STD error​:

<bbkr_> std​: enum A <a b c>; enum B <a b c>; say c.perl
<p6eval> std 04216b1​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Illegal redeclaration of
symbol 'a' (see line 1) at /tmp/Ptu5rCvAvQ line 1​:␤------> �[32menum A <a b c>; enum B <a b
c>�[33m⏏�[31m; say c.perl�[0m␤Illegal redeclaration of symbol 'b' (see line 1) at /tmp/Ptu5rCvAvQ
line 1​:␤------> �[32m…

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @masak

On Thu Nov 15 05​:16​:59 2012, bbkr wrote​:

2012.10 - still broken (should fail on redeclaration)

<bbkr_> rakudo​: enum A <a b c>; enum B <a b c>; say c.perl
<p6eval> rakudo c82d10​: OUTPUT«B​::c␤»

Just for the record; no, it shouldn't fail on redeclaration (despite
STD's error message). The spec says that the a, b, and c slots become
"poisoned" and can't be used as-is anymore. They have to be specified as
A​::a etc.

@p6rt
Copy link
Author

p6rt commented Nov 9, 2014

From @FROGGS

Patch​: rakudo/rakudo@e340863189
Tests​: Raku/roast@fc3dc9958e

@p6rt p6rt closed this as completed Nov 9, 2014
@p6rt
Copy link
Author

p6rt commented Nov 9, 2014

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

@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