On 30/10/2020 07:58, Paul Procacci wrote:
Here is what I have ... trimmed.

#################################################################
use JSON::Pretty;
use Staticish;

unit class MyClass is Static;

method client(::?CLASS:D: Str:D $service! --> MyClass)
{
        my %data := from-json %?RESOURCES{$service}.slurp;
        my $type = Metamodel::ClassHOW.new_type(
                name => $service,
                ver => v0.0.1,
                auth => 'github:me'
        );

        $type.HOW.add_parent($type, 'MyClass');
        $type.HOW.compose($type);
        $type.new;
}
#################################################################


Hi Paul,

I think when you're passing a string to add_parent, you're actually setting the class Str as the parent. raku will not go looking for a class with that name. Instead, it expects you to pass the actual type object.

Hope that helps!
  - Timo

Reply via email to