klyn.Type.createInstance
method

    public createInstance(args... as Object) as Object throws Exception:

Description

Creates an instance of this type through reflection.

The selected constructor is the constructor accepting the supplied argument count. Constructors with default trailing parameters can therefore be called with omitted arguments.

Parameters

Parameter | Description
--- | ---
`args` | Constructor arguments.

Returns

New instance.

Throws

- Exception if no constructor matches or if construction fails.

Example

    user = User.type.createInstance("Alice") as User