use JSON::Unmarshal;
class C {
has Str %.bla{subset :: of Str where any("ble", "blob")}
};
unmarshal( 「{"bla": {"ble": "bli"}}」, C);
Gives rise to:
No appropriate parametric role variant available for 'Associative'
in sub _unmarshal at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/site/sources/BD58585C8BB103CC821AB89EFD8D30DA4FB8FDF9 (JSON::Unmarshal) line 127
in block at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/site/sources/BD58585C8BB103CC821AB89EFD8D30DA4FB8FDF9 (JSON::Unmarshal) line 108
in sub _unmarshal at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/site/sources/BD58585C8BB103CC821AB89EFD8D30DA4FB8FDF9 (JSON::Unmarshal) line 92
in sub unmarshal at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/site/sources/BD58585C8BB103CC821AB89EFD8D30DA4FB8FDF9 (JSON::Unmarshal) line 157
in block <unit> at jc line 7
This was reported in https://github.com/jonathanstowe/JSON-Class/issues/3
It seems that a class such as:
Gives rise to:
I will investigate and try and fix.