Open gravelld opened 7 years ago
The issue is that bind(new TypeLiteral[Option[String]]() {})
is invoking the guice native method and thus not returning the scala wrapped builders that support the .toProvider[AnOptionProvider]
syntax.
This does work:
bind[Option[String]].toProvider[AnOptionProvider]
I'm looking into what it would take to override the methods and return the Scala versions.
This is an issue I have tried to resolve before, unfortunately at every turn I end up with an ambiguous method error.
Consider:
I can do:
bind(new TypeLiteral[Option[String]]() {}).toProvider(classOf[AnOptionProvider])
But I can't do:
bind(new TypeLiteral[Option[String]]() {}).toProvider[AnOptionProvider]
Which is slightly more elegant.
I get the feeling I'm missing something from the README when it says:
Assuming this solved it, could that example be fleshed out?