Skip to content
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

Provide useful error when an interface can't be resolved but there are implementing types in depinject #11908

Closed
Tracked by #11899
aaronc opened this issue May 9, 2022 · 0 comments · Fixed by #12169
Labels
C:depinject Issues and PR related to depinject

Comments

@aaronc
Copy link
Member

aaronc commented May 9, 2022

Given two interfaces:

type Foo {
  Foo()
}

type FooBar {
  Foo
  Bar()
}

If a depinject provider requires Foo, but FooBar is provided in the container there will be an error and we won't know that FooBar is a possible solution. Depinject should search for all interfaces which implement the required interface and suggest these as options to the user. Ex:

Provide needFoo needs the interface Foo, possible match(es) are:
  FooBar
@aaronc aaronc added the C:depinject Issues and PR related to depinject label May 9, 2022
@aaronc aaronc changed the title Provide useful error when an interface can't be resolved but there are implementing types in the container Provide useful error when an interface can't be resolved but there are implementing types in depinject May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:depinject Issues and PR related to depinject
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants