You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Task :hiltJavaCompileDebug FAILED
P:\projects\bugs\dagger\hilt-viewmodel-redundant-cast-Map\build\generated\hilt\component_sources\debug\com\example\DaggerApp_HiltComponents_SingletonC.java:402: warning: [cast] redundant cast to Map
return (Map) Collections.<String, javax.inject.Provider<ViewModel>>singletonMap("com.example.MyViewModel", ((Provider) myViewModelProvider));
^
error: warnings found and -Werror specified
1 error
1 warning
Control
rm -rf build .gradle (Hard clean necessary for some reason when changing version)
Edit build.gradle.kts: s/2.50/2.49/g
gradlew build -> success
Context
There's a project that slowly migrates from Java 1.7 to Kotlin. The sourceCompatibility is intentionally kept low, so that the existing codebase doesn't show full of warnings ("can use lambdas") on all anonymous inner class listeners and other places. Up until 2.49 there was no issue, but when I updated to 2.50, I started getting this issue. The 2.50 release notes doesn't show anything relevant.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. This got introduced in the last release because the Map types now hold different Provider types due to the Jakarta changes, and now may not be easily made to match the types request. I'll send a fix to suppress this warning.
These were introduced in a previous change that introduced the `dagger.internal.Provider` type. They are difficult to avoid with Map Providers.
Fixes#4201.
RELNOTES=Fixes#4201.
PiperOrigin-RevId: 596063894
These were introduced in a previous change that introduced the `dagger.internal.Provider` type. They are difficult to avoid with Map Providers.
Fixes#4201.
RELNOTES=Fixes#4201.
PiperOrigin-RevId: 596063894
Repro Steps
gradlew build
Expected
BUILD SUCCESSFUL
Actual
Control
rm -rf build .gradle
(Hard clean necessary for some reason when changing version)s/2.50/2.49/g
gradlew build
-> successContext
There's a project that slowly migrates from Java 1.7 to Kotlin. The
sourceCompatibility
is intentionally kept low, so that the existing codebase doesn't show full of warnings ("can use lambdas") on all anonymous inner class listeners and other places. Up until 2.49 there was no issue, but when I updated to 2.50, I started getting this issue. The 2.50 release notes doesn't show anything relevant.The text was updated successfully, but these errors were encountered: