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:
m: class A { ... }; class B does A { }; class A { }
rakudo-moar a581bf: OUTPUT«Unhandled exception: No such method 'item'
for invocant of type 'A' at :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…»
m: role A { ... }; class B does A { }; role A { }
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 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 :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:)
> 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:)
> from :1
> (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:)
> from :1
> (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:)
>
> 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".