Is it possible to inject an object with scala-guice?
I would like to inject the scala.io.Source but I failed to find a working solution. This is what I have so far: class Foo @Inject()(var source:Source) { // ... } And the binding: class DependencyInjection extends AbstractModule with ScalaModule { def configure:Unit = { bind[Source.type].to[Source] // bind[Source] didn't work } } Maybe I can wrap the scala.io.Source calls into a local class but it doesn't sound right. Is there a way to inject objects with scala-guice? Because Source is an abstract class, and there are no public extensions for it (and even if there were, you wouldn't be able to