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

Owner: Nobody
Requestors: mt1957 [at] gmail.com
Cc:
AdminCc:

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



Subject: perl6 changes breaking code
Date: Tue, 13 Dec 2016 11:10:09 +0100
To: rakudobug [...] perl.org
From: mt1957 <mt1957 [...] gmail.com>
Download (untitled) / with headers
text/plain 2.7k
Hi, Recently after pulling the newest rakudo/moarvm (2016.11-238-g2f502b4 built on MoarVM version 2016.11-41-gd2139b5 implementing Perl 6.c) I saw errors in my code which compiled ok before. This is difficult to golf down because it disappears when used in another context. So better explain my way of coding. The error I get now is /home/marcel/Languages/Perl6/Projects/mongo-perl6-driver/xt/Sxml/driver-authentication.t .. ===SORRY!=== Type 'MongoDB::Server' is not declared at /home/marcel/Languages/Perl6/Projects/mongo-perl6-driver/lib/MongoDB/Client.pm6 (MongoDB::Client):152 ------> my MongoDB::Server⏏ $server .= new( Malformed my at /home/marcel/Languages/Perl6/Projects/mongo-perl6-driver/lib/MongoDB/Client.pm6 (MongoDB::Client):152 ------> my MongoDB::⏏Server $server .= new( The module in question has the following at the top use v6.c; use MongoDB::Server; use MongoDB::Database; use MongoDB::Collection; use MongoDB::Uri; use MongoDB::Wire; use MongoDB::Authenticate::Credential; use MongoDB; use BSON::Document; use Semaphore::ReadersWriters; #------------------------------------------------------------------------------- unit package MongoDB:auth<https://github.com/MARTIMM>; #------------------------------------------------------------------------------- class Client { ... my MongoDB::Server $server .= new( :client(self), :$server-name, :$loop-time ); .... } The server class is defined likewise as use v6.c; use MongoDB; use MongoDB::Server::Monitor; use MongoDB::Server::Socket; use MongoDB::Authenticate::Credential; use MongoDB::Authenticate::Scram; use BSON::Document; use Semaphore::ReadersWriters; use Auth::SCRAM; #------------------------------------------------------------------------------- unit package MongoDB:auth<https://github.com/MARTIMM>; #------------------------------------------------------------------------------- class Server { ... } When e.g. the line 'use MongoDB::Uri' is moved above that of MongoDB::Server (in the Client module) another error is returned; Type 'MongoDB::Uri' is not declared at /home/marcel/Languages/Perl6/Projects/mongo-perl6-driver/lib/MongoDB/Client.pm6 (MongoDB::Client):99 ------> my MongoDB::Uri⏏ $uri-obj .= new(:$!uri); Malformed my at /home/marcel/Languages/Perl6/Projects/mongo-perl6-driver/lib/MongoDB/Client.pm6 (MongoDB::Client):99 ------> my MongoDB::⏏Uri $uri-obj .= new(:$!uri); Now I found out that when the 'unit package' line is moved above the use statements, the error disappears. Can anyone shed some light over this? I know that use statements can be used within package, module and class to narrow the scope of definitions but I can't remember anything which could explain this behavior. Thanks, Marcel
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 3.3k
On Tue, 13 Dec 2016 02:11:12 -0800, mt1957@gmail.com wrote: Show quoted text
> Hi, > > Recently after pulling the newest rakudo/moarvm (2016.11-238-g2f502b4 > built on MoarVM version 2016.11-41-gd2139b5 implementing Perl 6.c) I > saw > errors in my code which compiled ok before. This is difficult to golf > down because it disappears when used in another context. So better > explain my way of coding. > > The error I get now is > > /home/marcel/Languages/Perl6/Projects/mongo-perl6- > driver/xt/Sxml/driver-authentication.t > .. > ===SORRY!=== > Type 'MongoDB::Server' is not declared > at > /home/marcel/Languages/Perl6/Projects/mongo-perl6- > driver/lib/MongoDB/Client.pm6 > (MongoDB::Client):152 > ------> my MongoDB::Server⏏ $server .= new( > Malformed my > at > /home/marcel/Languages/Perl6/Projects/mongo-perl6- > driver/lib/MongoDB/Client.pm6 > (MongoDB::Client):152 > ------> my MongoDB::⏏Server $server .= new( > > > The module in question has the following at the top > > use v6.c; > > use MongoDB::Server; > use MongoDB::Database; > use MongoDB::Collection; > use MongoDB::Uri; > use MongoDB::Wire; > use MongoDB::Authenticate::Credential; > use MongoDB; > > use BSON::Document; > use Semaphore::ReadersWriters; > > #------------------------------------------------------------------------------- > unit package MongoDB:auth<https://github.com/MARTIMM>; > > #------------------------------------------------------------------------------- > class Client { > ... > my MongoDB::Server $server .= new( > :client(self), :$server-name, :$loop-time > ); > .... > } > > > The server class is defined likewise as > > use v6.c; > > use MongoDB; > use MongoDB::Server::Monitor; > use MongoDB::Server::Socket; > use MongoDB::Authenticate::Credential; > use MongoDB::Authenticate::Scram; > > use BSON::Document; > use Semaphore::ReadersWriters; > use Auth::SCRAM; > > #------------------------------------------------------------------------------- > unit package MongoDB:auth<https://github.com/MARTIMM>; > > #------------------------------------------------------------------------------- > class Server { ... } > > > When e.g. the line 'use MongoDB::Uri' is moved above that of > MongoDB::Server (in the Client module) another error is returned; > > Type 'MongoDB::Uri' is not declared > at > /home/marcel/Languages/Perl6/Projects/mongo-perl6- > driver/lib/MongoDB/Client.pm6 > (MongoDB::Client):99 > ------> my MongoDB::Uri⏏ $uri-obj .= new(:$!uri); > Malformed my > at > /home/marcel/Languages/Perl6/Projects/mongo-perl6- > driver/lib/MongoDB/Client.pm6 > (MongoDB::Client):99 > ------> my MongoDB::⏏Uri $uri-obj .= new(:$!uri); > > > Now I found out that when the 'unit package' line is moved above the > use > statements, the error disappears. Can anyone shed some light over > this? > I know that use statements can be used within package, module and > class > to narrow the scope of definitions but I can't remember anything which > could explain this behavior. > > Thanks, > Marcel
Hi, How did you build your Perl 6? That version number looks suspicious. You say you're on 2016.11-238-g2f502b4, but the current HEAD/nom is 2016.11-226-g1d46004, 12 commits fewer than yours. The most obvious answer is you're in possession of a time machine and are reporting bugs from the future. In which case, would you mind including this week's lottery numbers in your reply? Let us know, Thank you.
Subject: Re: [perl #130338] perl6 changes breaking code
From: mt1957 <mt1957 [...] gmail.com>
To: perl6-bugs-followup [...] perl.org
Date: Wed, 14 Dec 2016 11:16:42 +0100
Download (untitled) / with headers
text/plain 1.3k
Hi, Show quoted text
> How did you build your Perl 6? > > That version number looks suspicious. You say you're on 2016.11-238-g2f502b4, but the current HEAD/nom is 2016.11-226-g1d46004, 12 commits fewer than yours. > > The most obvious answer is you're in possession of a time machine and are reporting bugs from the future. In which case, would you mind including this week's lottery numbers in your reply? > > Let us know, > Thank you.
Hi, Well, it is one of those undocumented features of perl 6 :-) About the lottery: 42 42 42 42 42 42 42 ... What I do is pulling rakudo directly from the repo like I did this morning(11:05 CET); Show quoted text
> git pull
remote: Counting objects: 159, done. remote: Compressing objects: 100% (21/21), done. remote: Total 159 (delta 110), reused 102 (delta 102), pack-reused 35 Receiving objects: 100% (159/159), 47.58 KiB | 0 bytes/s, done. Resolving deltas: 100% (113/113), completed with 32 local objects. From git://github.com/rakudo/rakudo 5d6a8e9..7b09bee nom -> origin/nom ... Then Show quoted text
> perl Configure.pl --gen-moar --backends=moar > make test > make install
After the installation Show quoted text
> perl6 -v
This is Rakudo version 2016.11-271-g416e83b built on MoarVM version 2016.11-41-gd2139b5 What about this version? is it better? 40 commits further than 238. (maybe its a pull count instead of commit count ;-) Thanks for all of your work everyone (I must say it somewhere someplace) Marcel
To: perl6-bugs-followup [...] perl.org
Date: Wed, 14 Dec 2016 13:14:56 +0100
From: mt1957 <mt1957 [...] gmail.com>
Subject: Re: [perl #130338] perl6 changes breaking code
Download (untitled) / with headers
text/plain 258b
Hi, I've rebuild rakudo from the ground up. Version I get now is 2016.11-236-g7b09bee built on MoarVM version 2016.11-41-gd2139b5 which looks better now. However, problem still exist. Can do for now with the unit package line before all use statements.


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