-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Labels
Description
Describe the bug
The following are Java and Kotlin definitions of a function with a parameter with a contravariant type:
public void bar(java.util.List<? super String> param) {}
fun bar(param: List<in String>) {}
The Kotlin definition is correctly parsed as Contravariant
with a bound of String
, but the Java definition becomes Covariant
with a bound of Object
.
It seems like in the PSI model, a PsiWildcardType
will always have an extendsBound
of java.lang.Object
, even if that is not explicitly written in the source. In DokkaPsiParser.getVariance
, because the extendsBound
is checked first, wildcard types will always turn into Covariant
s, even when they have a contravariant super
bound.
Are you willing to provide a PR?
I think #3092 fixes the issue