I put the full code up here: https://github.com/frezik/Games-Tetrachromat/tree/perl6_bug. It's demonstrated by doing:
$ perl6 -I lib t/010_packet_ack.t
1..7
Type check failed for return value; expected Game::Tetrachromat::Packe
+t but got Any (Any)
in method read_packet at /home/tmurray/proj/Game-Tetrachromat/lib/Ga
+me/Tetrachromat/PacketFactory.pm6 (Game::Tetrachromat::PacketFactory)
+ line 79
in block <unit> at t/010_packet_ack.t line 33
# Looks like you planned 7 tests, but ran 0
The factory is in lib/Game/Tetrachromat/PacketFactory.pm6, and the class it's supposed to be using for this test is lib/Game/Tetrachromat/Packet/Ack.pm6. All packet types do the role lib/Game/Tetrachromat/Packet.pm6.
I was able to work around things by converting Game::Tetrachromat::Packet to a class instead of a role, and using BUILDALL for Packet::Ack. Inheritance is arguably the right way to go for this particular case, so I'll probably just leave it that way. Still, if there's a bug in perl6, I figured it was worth putting up the code that breaks it.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.