Skip to content

injectInto. Issue with optionals #308

@CrazyFlasher

Description

@CrazyFlasher
class MockCommand_6 extends AbstractCommand
{
    @Inject("bool")
    @Optional
    private var bool:Bool = true;

    @Inject("iint")
    @Optional
    private var iint:Int = 1;

    override public function execute():Void
    {
        if (!bool || iint != 1)
        {
            throw Error.Custom("MockCommand_6: invalid values: " +  bool + " " + iint);
        }
    }
}

If I inject into MockCommand_6 without having mappings for "bool" and "iint", injector makes the to be null (for js). But in my opinion they should keep their default values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions