-
Notifications
You must be signed in to change notification settings - Fork 2k
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
warning: [unchecked] unchecked method invocation: method singletonMap in class Collections is applied to given types #1039
Comments
Shouldn't we be specifying type parameters there ( dagger/java/dagger/internal/codegen/MapBindingExpression.java Lines 134 to 140 in beeb29d
Can you provide a failing example? |
@ronshapiro A failing example? The code above fails with The specific line is: |
I meant a small repo that exhibits the issue (that we can test+verify a fix on) |
@ronshapiro Oh sorry, I usually add that in the description. Here are the repro steps:
|
Any update on this? |
I see what's happening - there's a Unfortunately, I don't know of a good way to fix this without suppressing warnings over far too much code. |
Actually, we may be able to check in |
@ronshapiro Any updates? I suppose that would be better to suppress warning if it's hard/impossible to fix, after all this is generated code. This cause problem with real problems detection using
for the generated code of method |
I'm leaning towards an approach like this one: #1248 (comment) |
It's little bit unfortunate that it cannot be fixed on side of dagger, but approach form your comment still works and allows use -Werror |
An internal change recently enable these warnings (which seem to have been turned off by default). This is causing spam for Dagger builds because we haven't traditionally been aware of the issues where this arises. This is a temporary stopgap measure to disable those warnings until we build infrastructure to determine how to locally-suppress this code. Also fix two of these warnings in our own test code. Fixes #1039 Fixes #1172 RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251730395
An internal change recently enable these warnings (which seem to have been turned off by default). This is causing spam for Dagger builds because we haven't traditionally been aware of the issues where this arises. This is a temporary stopgap measure to disable those warnings until we build infrastructure to determine how to locally-suppress this code. Also fix two of these warnings in our own test code. Fixes #1039 Fixes #1172 RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251730395
Can suppress
unchecked
in the generated code to prevent warnings during compilation?Issue:
warning: [unchecked] unchecked method invocation: method singletonMap in class Collections is applied to given types
Error:
Temp fix:
"-Xlint:-unchecked"
The text was updated successfully, but these errors were encountered: