A callable constructor model represents the model of a Ceylon class constructor that you can invoke and inspect
As with Function
you can also invoke a CallableConstructor
, doing so
instantiates an instance:
shared class Foo { shared String name; shared new foo(String name) { this.name = name; } } void test() { Constructor<Foo,[String]> ctor = `Foo.foo`; // This will print: Stef print(ctor("Stef").name);
This class inherits Generic
but a constructor in Ceylon cannot
have a type parameters.
For symmetry with CallableConstructorDeclaration.apply()
the
Generic.typeArguments
and Generic.typeArgumentList
refer to the type arguments
of the constructor's class.
no type hierarchy
no subtypes hierarchy
Attributes | |
container | Source Codeshared formal ClassModel<Type,Nothing>? container The class containing this constructor; the type of instances produced by this constructor. |
declaration | Source Codeshared formal CallableConstructorDeclaration declaration This constructor's declaration. |
type | Source Codeshared formal ClassModel<Type,Nothing> type This function's return closed type. Refines FunctionModel.type |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Declared |
Attributes inherited from: FunctionModel<Type,Arguments> |
Attributes inherited from: Functional |
Attributes inherited from: Generic |
Attributes inherited from: Model |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Applicable<Type,Arguments> |