Closed
Description
This snippet may be accidentally written to declare a multibinding
@Module
interface Example {
@Multibinding
Map<String, Provider<String>> someBindings();
}
The error is that it's using a Provider
in the declaration when it should just be Map<String, String>
. However, the error message is a little confusing as it seems to imply that it's not a Map
at all.
error: @Multibinds methods must return Map<K, V> or Set<T>
I think it would be easier for folks to debug if this message could be more explicit, such as mentioning that dagger intrinsic types like Provider
and Lazy
are not supported and mentioning if it sees one in the signature.
Activity
Better error messages for invalid @Multibinds types.
Better error messages for invalid @Multibinds types.
ZacSweers commentedon Jan 9, 2023
Thanks!
Better error messages for invalid @Multibinds types.