role A[%types?] {
%types{ ::?CLASS.prefix } := ::?CLASS if ::?CLASS.^find_method("prefix", :local);
method prefix {...};
method WHICH {"bbb"};
method dump-types { dd %types }
}
class B does A {
method prefix {"aaa"}
}
class C does A {
method prefix {"ccc"}
}
B.dump-types;
C.dump-types;