Thanks for the report.
Fixed in https://github.com/rakudo/rakudo/commit/a822bcf9cf
Tests added in https://github.com/perl6/roast/commit/1e5a081bed
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
# New Ticket Created by hanenkamp
# Please include the string: [perl #129906]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=129906 >
One line example of the problem:
% perl6 -e 'class A { ... }; class B does A { }; role A {