-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stackoverflow when exposing parents of Subcomponents #4330
Comments
We should probably do better than stackoverflow, however, what's happening here is that there are (unfortunately) multiple ways to declare a subcomponent as a child of another component/subcomponent, and one of those ways is to add a entry point method on the parent component/subcomponent interface that returns the child subcomponent. So when you add the You can probably work around this for now by using an It looks like there's a bug in our validation logic that causes this loop. |
I think I follow, but if you delete I checked in the debugger, the returned instance is the same as the one used to create UserComponent instance from..so no surprises. Is it because |
Yea, you can't make a |
I see. So other than fixing the overflow to get a better error message, and hacking around with @BINDS, a proper way doesnt seem feasible, since all viable syntax is already taken? |
Yea, you won't be able to do exactly what you wrote in the original comment, however, we should fix the overflow. Also, I think if you did |
by |
Yup, that's right. |
I want to expose parent reference of a subcomponent, since the generated implementation has the reference. (Trying to build a component cache that is a tree)
Simply adding a
val parent: AppComponent
onUserComponent
worked. But unfortunately it doesn't work for subcomponent trees deeper than 2, then compilation stackoverflows.dagger 2.51.1
The text was updated successfully, but these errors were encountered: