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


HI!

Probably I  I miss the syntax, but I am trying to make an alias for
exported module function and have this alias exported either.

$ cat lib/Foo.pm6
use v6;

unit module Foo;

sub foo is export { say "hi there" }


$ perl6 -Ilib  -e 'use Foo; foo()'
hi there


///

$ cat lib/Foo.pm6
use v6;

unit module Foo;

sub foo is export { say "hi there" }

constant &foo-alias = &foo;

perl6 -Ilib  -e 'use Foo; Foo::foo-alias()'
hi there

///

But last one does not compile:

use v6;

unit module Foo;

sub foo is export { say "hi there" }

constant &foo-alias is export = &foo;


$ perl6  -c lib/Foo.pm6
===SORRY!=== Error while compiling /home/melezhik/projects/tmp/lib/Foo.pm6
Can't use unknown trait 'is export' in a sub declaration.
at /home/melezhik/projects/tmp/lib/Foo.pm6:7
    expecting any of:
        rw raw hidden-from-backtrace hidden-from-USAGE
        pure default DEPRECATED inlinable nodal
        prec equiv tighter looser assoc leading_docs trailing_docs


Regards.

Alexey

Reply via email to