Skip to content

Commit

Permalink
Warn about @JvmSuppressWildcards.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 547330693
  • Loading branch information
wanyingd1996 authored and Dagger Team committed Jul 11, 2023
1 parent ba73556 commit 4ce467b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ private void reportMissingBinding(
wildcardAlternatives.stream()
.map(
binding -> binding.key().type() + " in [" + binding.componentPath() + "]")
.collect(toImmutableSet())));
.collect(toImmutableSet())))
+ "\n(In Kotlin source, a type like 'Set<Foo>' may"
+ " be translated as 'Set<? extends Foo>'. To avoid this implicit"
+ " conversion you can add '@JvmSuppressWildcards' on the associated type"
+ " argument, e.g. 'Set<@JvmSuppressWildcards Foo>'.)";
}

List<ComponentPath> alternativeComponents =
Expand Down

0 comments on commit 4ce467b

Please sign in to comment.