# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #63650]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=63650 >


Pugs r25693 contains clarification on what should happen when a short
name of an enum value is the same as a sub name.

1438    Like type names, enum names are parsed as standalone tokens
1439    representing scalar values, and don't look for any arguments.
1440    Unlike type names which are undefined protoobjects, enums are defined
1441    constant values. Also unlike types, they do not respond to C<.()>.
1442    They may not be post-declared.
1443    
1444    our enum Maybe <OK FAIL>;
1445    sub OK {...}
1446    $x = OK; # certainly the enum value
1447    $x = OK() # certainly the function

I've added a test for that to t/spec/S12-enums/basic.t

The first part (meaning the enum value without parens) works in Rakudo,
the second dies with

too few arguments passed (0) - 1 params expected
current instr.: '_block325' pc 1991 (EVAL_25:554)
called from Sub '_block157' pc 2995 (EVAL_25:898)
...

at run time.

Cheers,
Moritz

Reply via email to