Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Missing commas in import tags silently ignored #5628

Open p6rt opened 8 years ago

p6rt commented 8 years ago

Migrated from rt.perl.org#129143 (status was 'open')

Searchable as RT129143$

p6rt commented 8 years ago

From @skids

$ 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

p6rt commented 8 years ago

From @LLFourn

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​:

# 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-archive.perl.org/perl6/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

p6rt commented 8 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 8 years ago

From @zoffixznet

On Tue Aug 30 20​:33​:54 2016, lloyd.fourn@​gmail.com wrote​:

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-archive.perl.org/perl6/Ticket/Display.html?id=127134#ticket-history