# New Ticket Created by raiph
# Please include the string: [perl #127870]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=127870 >
What I did
==========
package foo {}
enum foo <a>
What I expected
===============
The same redeclaration error I get when I write:
enum foo <a>;
package foo {}
# Redeclaration of symbol foo
What I got
==========
No error.
Comments
========
I took a brief look at matches of "redeclaration" in
https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp
My quick guess on what's going on is that the redeclaration check grew
organically (and would probably benefit from a refactor) and the basic approach
taken doesn't mesh well with enums due to either their weirdness regarding enum
types and enum symbols and/or how the grammar/action code deals with declarator
vs declarand parts of an enum.