On Wed May 08 18:16:40 2013, grond...@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$ 

Reply via email to