needle icon indicating copy to clipboard operation
needle copied to clipboard

.init not recognized by generator

Open fabianmuecke opened this issue 4 years ago • 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?

fabianmuecke avatar Aug 16 '21 08:08 fabianmuecke

same issue

Ar4ibald avatar Aug 31 '21 21:08 Ar4ibald

Also same issue

farzadshbfn avatar Apr 18 '23 12:04 farzadshbfn