DoclerLabs / hexMachina

Releases, issues, documentation, website of hexMachina, framework written in Haxe
http://hexmachina.org
MIT License
44 stars 8 forks source link

Unable to use static call within array construction #298

Closed gene-pavlovsky closed 6 years ago

gene-pavlovsky commented 6 years ago

There's this Flow code that works:

    awardsInfoWindowDecorationList = new Array<com.mvc.vo.base.BaseVO>(awardsInfoWindowLocator, simpleWindowStyle);
    awardsInfoWindowLocator = js.com.mvc.vo.window.WindowLazyLocatorVO.fromSelector(".js_awards_info", awardsInfoView);

I thought I'd remove the unneeded locator variable like so:

    awardsInfoWindowDecorationList = new Array<com.mvc.vo.base.BaseVO>(
        js.com.mvc.vo.window.WindowLazyLocatorVO.fromSelector(".js_awards_info", awardsInfoView), 
        simpleWindowStyle
    );

But this doesn't compile, error message is not helpful either. The WindowLazyLocatorVO.fromSelector is a static function that returns a BaseVO.

FrancisBourre commented 6 years ago

I added instance and static methods.

@context
{
    @public
    o1 = new Array<Int>(
        hex.mock.MathUtil.sum( 1, 2 ), 
        hex.mock.MathUtil.sum( 3, 4 ), 
        hex.mock.MathUtil.sum( 5, 6 )
    );

    @public
    o2 = new Array<String>(
        stringifier.string(1),
        stringifier.string(2),
        stringifier.string(3)
    );

    stringifier = new hex.mock.Stringifier();
}
gene-pavlovsky commented 6 years ago

Cool, thanks!