Direct Known Satisfying Interfaces: Attribute<Container,Get,Set>, MemberClass<Container,Type,Arguments>, MemberInterface<Container,Type>, Method<Container,Type,Arguments>

Model for members that can be bound to a containing instance to turn them into toplevel models.

You can bind a member to an instance by invoking that member with the instance as parameter:

shared class Outer(String name){
    shared class Inner(){
        shared String hello => "Hello "+name;
    }
}

void test(){
    Member<Outer,Class<Outer.Inner,[]>> memberClass = `Outer.Inner`;
    Class<Outer.Inner,[]> c = memberClass(Outer("Stef"));
    // This will print: Hello Stef
    print(c().hello);
}
Attributes
declaringTypeSource Code
shared formal Type<Anything> declaringType

The declaring closed type. This is the type that declared this member.

Inherited Attributes
Attributes inherited from: Object
Methods
bindSource Code
shared formal Model bind(Object container)

Type-unsafe container binding, to be used when the container type is unknown until runtime.

This has the same behaviour as invoking this Member directly, but exchanges compile-time type safety with runtime checks.

Throws:
Inherited Methods
Methods inherited from: Object