# New Ticket Created by  Dan Zwell 
# Please include the string:  [perl #132113]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132113 >


The following code works fine if run in a script or with `perl6 -e '...'`,
but fails when run in the REPL:

class KG { has $.amount; }
sub postfix:<kg>(Numeric $amount) { KG.new(:$amount); }
say 10kg;

# Output from perl6 -e:
# KG.new(amount => 10)

# Output from the REPL is:
# ===SORRY!=== Error while compiling:
# Confused
# ------> say 10⏏g;

Interestingly, if a postfix operator like this is exported by a module
which is loaded by the REPL, the REPL can successfully parse that operator
just once, after which it will fail with an error similar to the above.

I'm using Rakudo version 2017.08-96-ge5a600997 built on MoarVM version
2017.08.1-135-ge86428d4 implementing Perl 6.c.

Reply via email to