Rakudo version 2020.01
This does not compile.
use v6;
class N1 {}
class T1 {}
class G1 {
has @.g is required where A1|Q1;
}
class Q1 {
has $.q is required where N1|T1|G1;
}
class A1 {
has Q1 @.a is required;
}
===SORRY!=== Error while compiling …
Illegally post-declared types:
A1 used at line 7
Q1 used at line 7
I thought that declaring just the identifiers ahead of G1 would help me, but this also fails:
===SORRY!=== Error while compiling …
Too late for unit-scoped class definition;
Please use the block form.
…:6
------> class A1;⏏ class Q1;
How do I make it work?