-
Notifications
You must be signed in to change notification settings - Fork 44
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
does not bind AnyVal
properly...
#49
Comments
By the way, I think you want this implementation of class BarProvider extends Provider[String] {
@Inject val foo: Foo = Foo.empty
def get() = foo.foo
} If you're looking to allow your import javax.annotation.Nullable
class BarProvider extends Provider[String] {
@Inject @Nullable val foo: Foo = Foo.empty
def get() = foo.foo
} |
Or possibly you wanted to do this? @Inject @Nullable val foo: Foo = null.asInstanceOf[Foo] I can't seem to reproduce the specific error that you're getting. Is there a specific version of guice/jvm/scala that you're using? |
Actually, I can't seem to get guice to inject the Foo inside of the BarProvider. So yeah, it doesn't seem like I can inject an AnyVal at all. |
@nbauernfeind that is really weird ! It does not throw exception now. However as I change |
Unless this is an
error:
|
A minimized example showing the problem.
output:
|
This throws
java.lang.reflect.MalformedParameterizedTypeException
. I think the problem isGuice
depends on Java reflection which cannot properly interpretAnyVal
, as I cannot assignnull
to the initial value ofFoo
inBarProvider
, sinceFoo
is not bounded byNull
The text was updated successfully, but these errors were encountered: