Should Raku typed enums work with custom types? I get compile errors when trying the following:
role A { }
class B does A { }
class C does A { }
my A enum E ( b => B, c => C );
results in
Cannot find method 'mro' on object of type Perl6::Metamodel::ParametricRoleGroupHOW
and
class D { }
my D enum F ( b => D.new, c => D.new );
results in
Cannot auto-generate a proto method for 'Int' in the setting
or does this fall under
Complex expressions for generating key-value pairs are not supported.
EDIT
Regarding the first example - it looks like Raku doesn't like roles as the type constraint. The same error is given when trying, e.g.
my Rational enum G ( one => 1/1, two => 1/2 );
and as for what I was really hoping for:
Using a type object as a value for an enum not yet implemented. Sorry.