There's another couple of LTA errors for this, such us when a stubbed class is 
attempted to be `does` with or when a stubbed role is `does` with before it's 
defined:

<ZoffixW> m: class A { ... }; class B does A { }; class A { }
<camelia> rakudo-moar a581bf: OUTPUT«Unhandled exception: No such method 'item' 
for invocant of type 'A'␤   at <unknown>:1  
(/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)␤
 from gen/moar/m-CORE.setting:26858  (/home/camelia/rakudo-m-inst-1/share/per…»
<ZoffixW> m: role A { ... }; class B does A { }; role A { }
<camelia> rakudo-moar a581bf: OUTPUT«Use of uninitialized value of type Any in 
string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify 
it to something meaningful.␤  in any try_select at gen/moar/m-Metamodel.nqp 
line 2647␤===SORRY!=== Error while compiling <t…»


On Mon, 17 Oct 2016 16:08:31 -0700, hanenkamp wrote:
> One line example of the problem:
> 
> % perl6 -e 'class A { ... }; class B does A { }; role A { }'
> Unhandled exception: No such method 'item' for invocant of type 'A'
>    at <unknown>:1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/CORE.setting.moarvm:print_exception)
>  from gen/moar/m-CORE.setting:24949
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/CORE.setting.moarvm:<anon>)
>  from gen/moar/stage2/NQPHLL.nqp:1559
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
>  from src/Perl6/Compiler.nqp:27
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
>  from gen/moar/stage2/NQPHLL.nqp:1499
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/NQPHLL.moarvm:command_line)
>  from gen/moar/m-main.nqp:47
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:MAIN)
>  from gen/moar/m-main.nqp:38
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:<mainline>)
>  from <unknown>:1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:<main>)
>  from <unknown>:1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:<entry>)
> 
> Clearly, it would be better for there to be a nice error like "type A
> stubbed as class on line X but implemented as role on line Y".



Reply via email to