codingwell / scala-guice

Scala extensions for Google Guice
Apache License 2.0
341 stars 44 forks source link

scala-guice does not bind primitive types correctly #48

Closed shengc closed 9 years ago

shengc commented 9 years ago

class IntProvider extends Provider[Int] { def get() = 1 }

trait Foo[T] { def get(): T }

class FooProvider extends Provider[Foo[Long]] { def get() = new Foo[Long] { def get() = 1L } }

IntProvider is bound as java.lang.Object, and FooProvider is bound as Foo[java.lang.Object]. If instead I bind to the java primitives directly, types are right.

nbauernfeind commented 9 years ago

Can you please include your guice module?

On Wed, Jun 10, 2015, 10:49 PM Mianwo notifications@github.com wrote:

class IntProvider extends Provider[Int] { def get() = 1 }

trait Foo[T] { def get() = T }

class FooProvider extends Provider[Foo[Long]] { def get() = new Foo[Long] { def get() = 1L } }

IntProvider is bound as java.lang.Object, and FooProvider is bound as Foo[java.lang.Object]. If instead I bind to the java primitives directly, types are right.

— Reply to this email directly or view it on GitHub https://github.com/codingwell/scala-guice/issues/48.

shengc commented 9 years ago

Sorry, this seems to be a very old issue without followup. This really is sporadic, and I cannot reproduce it any more.

nbauernfeind commented 9 years ago

Ok. Thanks for the update. Feel free to close this issue.