Skip Menu |
Report information
Id: 129143
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bri [at] abrij.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: :DEFAULT tag in "use" directive prevents import from subsequent tags
Download (untitled) / with headers
text/plain 940b
$ cat XX.pm6 unit module XX; our sub fee() is export { } our sub fie() is export(:tag1) { } our sub foo() is export(:tag1 :tag2) { } our sub fum() is export(:DEFAULT :tag3) { } $ PERL6LIB=. perl6 -e 'use XX; fee()' $ PERL6LIB=. perl6 -e 'use XX; fum()' $ PERL6LIB=. perl6 -e 'use XX :tag1; foo()' $ PERL6LIB=. perl6 -e 'use XX :tag2; foo()' $ PERL6LIB=. perl6 -e 'use XX :tag2 :DEFAULT; foo()' $ PERL6LIB=. perl6 -e 'use XX :DEFAULT :tag2; foo()' ===SORRY!=== Error while compiling -e Undeclared routine: foo used at line 1 $ PERL6LIB=. perl6 -e 'use XX :tag2 :tag1; foo()' $ PERL6LIB=. perl6 -e 'use XX :tag1 :tag2; foo()' $ PERL6LIB=. perl6 -e 'use XX :DEFAULT :tag3; fum()' $ PERL6LIB=. perl6 -e 'use XX :tag3 :DEFAULT; fum()' $ PERL6LIB=. perl6 -e 'use XX :tag1 :DEFAULT :tag2; foo()' $ PERL6LIB=. perl6 -e 'use XX :tag3 :DEFAULT :tag2; foo()' ===SORRY!=== Error while compiling -e Undeclared routine: foo used at line 1
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Wed, 31 Aug 2016 03:33:19 +0000
To: perl6-compiler [...] perl.org, bugs-bitbucket [...] rt.perl.org
Subject: Re: [perl #129143] :DEFAULT tag in "use" directive prevents import from subsequent tags
Download (untitled) / with headers
text/plain 1.4k
You have to have a comma after each tag. I think it will work if you do (can't test atm). It's def LTA that there's no syntax error. Arg parsing for use statements is LTA in general I think.

LL
On Wed, 31 Aug 2016 at 9:29 AM, Brian S. Julin <perl6-bugs-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  "Brian S. Julin"
# Please include the string:  [perl #129143]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=129143 >



$ cat XX.pm6
unit module XX;

our sub fee() is export { }

our sub fie() is export(:tag1) { }

our sub foo() is export(:tag1 :tag2) { }

our sub fum() is export(:DEFAULT :tag3) { }

$ PERL6LIB=. perl6 -e 'use XX; fee()'
$ PERL6LIB=. perl6 -e 'use XX; fum()'
$ PERL6LIB=. perl6 -e 'use XX :tag1; foo()'
$ PERL6LIB=. perl6 -e 'use XX :tag2; foo()'
$ PERL6LIB=. perl6 -e 'use XX :tag2 :DEFAULT; foo()'
$ PERL6LIB=. perl6 -e 'use XX :DEFAULT :tag2; foo()'
===SORRY!=== Error while compiling -e
Undeclared routine:
    foo used at line 1

$ PERL6LIB=. perl6 -e 'use XX :tag2 :tag1; foo()'
$ PERL6LIB=. perl6 -e 'use XX :tag1 :tag2; foo()'
$ PERL6LIB=. perl6 -e 'use XX :DEFAULT :tag3; fum()'
$ PERL6LIB=. perl6 -e 'use XX :tag3 :DEFAULT; fum()'
$ PERL6LIB=. perl6 -e 'use XX :tag1 :DEFAULT :tag2; foo()'
$ PERL6LIB=. perl6 -e 'use XX :tag3 :DEFAULT :tag2; foo()'
===SORRY!=== Error while compiling -e
Undeclared routine:
    foo used at line 1
Download (untitled) / with headers
text/plain 268b
On Tue Aug 30 20:33:54 2016, lloyd.fourn@gmail.com wrote: Show quoted text
> You have to have a comma after each tag. I think it will work if you
Tested. Yes, it works fine with commas. This is related to/same-cause as https://rt.perl.org/Ticket/Display.html?id=127134#ticket-history


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org