uber/needle

.init not recognized by generator

fabianmuecke opened this issue · 2 comments

Hey, I'm currently evaluating using Needle in our app and it looks quite promising. It took me quite some time to figure out, why the generator generated nothing beyond my RootComponent, though.

Turns out, I was doing:
var foo: FooComponent { .init(parent: self) } and the generator does not recognize the dependency between RootComponent and FooComponent that way. var foo: FooComponent { FooComponent(parent: self) } works as expected.

Maybe not the most important thing, as one should be using protocols for most things anyway and you can't make that mistake, when your return type is a protocol... But would it be possible to support that, just to eliminate the possibility of human error here?

same issue

Also same issue