Skip Menu |
Report information
Id: 130690
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: jdv79 <justin [at] devuyst.com>
Cc:
AdminCc:

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



From: Justin DeVuyst <justin [...] devuyst.com>
Subject: [BUG] [CONC] attribute from one role used in another via private method gone missing
To: <rakudobug [...] perl.org>
Date: Wed, 01 Feb 2017 13:01:05 -0500
Download (untitled) / with headers
text/plain 328b
See https://gist.github.com/anonymous/1bac642c0a774065bb087dab4e03c694. Note that the point of using the private method was because the attr is private in the real code. Can't repro if: * switch the "for (:k1<v1>)" to "for (1..1)" * change the foo method to public * have only one class * move send-and-store into the classes
Attached is the OP's gist, in case that URL ever stops working...
Subject: gistfile1.txt
Download gistfile1.txt
text/plain 3.8k
[jdv@new-host-2 p6-agent]$ cat t/99-test.t use v6; role Agent { has Str $.id is required; has $.state = {}; method !foo { $!state } } role Agent::WebSourceAgent { method send-and-store { for (:k1<v1>) { if self!foo { } } } } class Agent::AtomAgent does Agent does Agent::WebSourceAgent { method run { loop { self.send-and-store } } } class Agent::FeedBurnerAgent does Agent does Agent::WebSourceAgent { method run { loop { self.send-and-store } } } await map { start { CATCH { default { die "E:{$_.gist}:E"; exit; } }; $_ mod 2 ?? Agent::AtomAgent.new(:id("a-$_")).run !! Agent::FeedBurnerAgent.new(:id("f-$_")).run; } }, 1..50; # vim:ft=perl6 [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t Tried to get the result of a broken Promise in block <unit> at t/99-test.t line 22 Original exception: E:P6opaque: no such attribute '$!state' in type Agent::FeedBurnerAgent when trying to get a value in method foo at t/99-test.t line 7 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 :E in block at t/99-test.t line 23 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 real 0m0.541s user 0m0.974s sys 0m0.068s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t ^C real 1m13.959s user 4m51.781s sys 0m0.195s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t ^C real 0m22.663s user 1m27.439s sys 0m0.459s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t Tried to get the result of a broken Promise in block <unit> at t/99-test.t line 22 Original exception: E:P6opaque: no such attribute '$!state' in type Agent::FeedBurnerAgent when trying to get a value in method foo at t/99-test.t line 7 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 :E in block at t/99-test.t line 23 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 real 0m0.756s user 0m1.280s sys 0m0.110s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t ^C real 0m19.591s user 1m15.996s sys 0m0.464s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t Use of uninitialized value $s of type Any in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block at t/99-test.t line 23 Tried to get the result of a broken Promise in block <unit> at t/99-test.t line 22 Original exception: E:P6opaque: no such attribute '$!state' in type Agent::FeedBurnerAgent when trying to get a value in method foo at t/99-test.t line 7 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 :E in block at t/99-test.t line 23 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 real 0m0.692s user 0m1.159s sys 0m0.091s [jdv@new-host-2 p6-agent]$ time perl6 t/99-test.t Tried to get the result of a broken Promise in block <unit> at t/99-test.t line 22 Original exception: E:P6opaque: no such attribute '$!state' in type Agent::FeedBurnerAgent when trying to get a value in method foo at t/99-test.t line 7 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 :E in block at t/99-test.t line 23 in method send-and-store at t/99-test.t line 11 in method run at t/99-test.t line 15 in block at t/99-test.t line 24 real 0m0.512s user 0m0.854s sys 0m0.081s [jdv@new-host-2 ~]$ perl6 -v This is Rakudo version 2016.12-377-g7ddc5f7 built on MoarVM version 2016.12-113-gd1da1ba implementing Perl 6.c. [jdv@new-host-2 ~]$
To: <perl6-bugs-followup [...] perl.org>
From: Justin DeVuyst <justin [...] devuyst.com>
Subject: Re: [perl #130690] AutoReply: [BUG] [CONC] attribute from one role used in another via private method gone missing
Date: Thu, 02 Feb 2017 14:51:03 -0500
Download (untitled) / with headers
text/plain 1.1k
Note that running under MVM_SPESH_DISABLE=1 seems to elide the bug. On 2017.02.01 01:01 pm, perl6 via RT wrote: Show quoted text
> Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "[BUG] [CONC] attribute from one role used in another via private > method gone missing", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has > been > assigned an ID of [perl #130690]. > > Please include the string: > > [perl #130690] > > in the subject line of all future correspondence about this issue. To > do so, > you may reply to this message. > > Thank you, > perl6-bugs-followup@perl.org > > > ------------------------------------------------------------------------- > See > https://gist.github.com/anonymous/1bac642c0a774065bb087dab4e03c694. > > Note that the point of using the private method was because the attr > is > private in the real code. > > Can't repro if: > * switch the "for (:k1<v1>)" to "for (1..1)" > * change the foo method to public > * have only one class > * move send-and-store into the classes


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