Open justinfagnani opened 11 years ago
Should we fallback to the current constructor selection or only fallback to a no-args constructor and warn the user if there is none? The second behavior should prevent the user from forgetting to annotate the desired constructor with @inject, where the former could cause some confusion. (I have the later one implemented already, but that's easy to change)
I think falling back on the current behavior is good. If there's only one constructor, try to use it. This could be an option on the injector though.
Patch at #9 . I have not added the option to select the fallback behavior as I find it would add unnecessary clutter. Current behavior seems fine.
Instead of choosing the no-name constructor, Dado should choose the constructor based on the presence of an @inject annotation.
We can still fall back to the current constructor selection heuristic if no annotation is present.