ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

Latest minject `getResponse()` can break `getInstance()` #20

Closed jasononeil closed 9 years ago

jasononeil commented 9 years ago
class TestController extends Controller {
    @inject public var viewEngine:UFViewEngine;

    @:route("/") function home() {
        return new ViewResult({}).usingTemplateString( "Hello!" );
    }
}

When instantiating TestController, it will use injector.getResponse(UFViewEngine). Then in ViewResult.executeResult(), it will use injector.getInstance(UFViewEngine).

The call in ViewResult fails. This is to do with new minject. There's a fix in this pull request: https://github.com/massiveinteractive/minject/pull/43

This is likely the same issue seen in #19 judging by the comments on Gitter about a child injector having a null rule but the parent injector had the correct rule.