Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #117923] [BUG] can not augment List class

5 views
Skip to first unread message

grondilu @ yahoo . fr

unread,
May 8, 2013, 9:16:41 PM5/8/13
to bugs-bi...@rt.perl.org
# New Ticket Created by gron...@yahoo.fr
# Please include the string: [perl #117923]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117923 >


This is perl6 version 2013.04-55-gfe70494 built on parrot 5.2.0
revision RELEASE_5_2_0


use MONKEY_TYPING;
augment class List { proto method combinations(|) {*} }


Cannot look up attributes in a type object
current instr.: 'gimme' pc 285305 (src/gen/CORE.setting.pir:125270) (src/gen/CORE.setting:6051)
called from Sub 'sink' pc 294412 (src/gen/CORE.setting.pir:128913) (src/gen/CORE.setting:6359)
called from Sub 'MAIN' pc 381 (src/gen/perl6.pir:147) (src/main.nqp src/gen/main-version.nqp:42)
called from Sub '' pc 77 (src/gen/perl6.pir:56) (src/main.nqp src/gen/main-version.nqp:1)
called from Sub '' pc 1127 (src/gen/perl6.pir:404) (src/main.nqp src/gen/main-version.nqp:52)

Patrick R. Michaud via RT

unread,
May 11, 2013, 10:29:25 AM5/11/13
to perl6-c...@perl.org
On Wed May 08 18:16:40 2013, gron...@yahoo.fr wrote:
> This is perl6 version 2013.04-55-gfe70494 built on parrot 5.2.0
> revision RELEASE_5_2_0
>
>
> use MONKEY_TYPING;
> augment class List { proto method combinations(|) {*} }
>
>
> Cannot look up attributes in a type object

It works for me if I put a statement after the augment:

pmichaud@kiwi:~/p6/rakudo$ cat x.p6
use MONKEY_TYPING;
augment class List {
proto method combinations(|) { * }
}

say 1;
pmichaud@kiwi:~/p6/rakudo$ ./perl6 x.p6
1

I suspect the problem is that as the last statement in the block,
the augmented class is being returned to MAIN or some other
top-level routine which is then trying to do something with
it (such as convert it to an integer exit code).

I can get the same error as the original ticket without using "augment":

pmichaud@kiwi:~/p6/rakudo$ cat y.p6
use v6;

List;

pmichaud@kiwi:~/p6/rakudo$ ./perl6 y.p6
Cannot look up attributes in a type object
current instr.: 'gimme' pc 285293 (src/gen/CORE.setting.pir:125268)
(src/gen/CORE.setting:6051)
called from Sub 'sink' pc 294400 (src/gen/CORE.setting.pir:128911)
(src/gen/CORE.setting:6359)
called from Sub 'MAIN' pc 381 (src/gen/perl6.pir:147) (src/main.nqp
src/gen/main-version.nqp:42)
called from Sub '' pc 77 (src/gen/perl6.pir:56) (src/main.nqp
src/gen/main-version.nqp:1)
called from Sub '' pc 1127 (src/gen/perl6.pir:404) (src/main.nqp
src/gen/main-version.nqp:52)
pmichaud@kiwi:~/p6/rakudo$

Patrick R. Michaud via RT

unread,
May 11, 2013, 2:18:59 PM5/11/13
to perl6-c...@perl.org
Now fixed in b1695cf:

pmichaud@kiwi:~/p6/rakudo$ cat x.p6
use MONKEY_TYPING;
augment class List {
proto method combinations(|) { * }
}

pmichaud@kiwi:~/p6/rakudo$ ./perl6 x.p6
pmichaud@kiwi:~/p6/rakudo$

Ticket closable with tests (hint: test that List.sink doesn't fail).

Pm

Will Coleda via RT

unread,
May 11, 2013, 4:20:49 PM5/11/13
to perl6-c...@perl.org
Link.sink test added; closing ticket.
--
Will "Coke" Coleda
0 new messages