Skip to content

Commit

Permalink
Small correction to resolveConeTypeProjection()
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Oct 7, 2023
1 parent cd91d57 commit 6b003c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,9 @@ class KotlinTypeMapping(typeCache: JavaTypeCache, firSession: FirSession) : Java
for (bound: FirTypeRef in typeParameter.bounds) {
bounds.add(type(bound))
}
if ("out" == typeParameter.variance.label) {
variance = JavaType.GenericTypeVariable.Variance.COVARIANT
} else if ("in" == typeParameter.variance.label) {
if (typeParameter.variance == Variance.IN_VARIANCE) {
variance = JavaType.GenericTypeVariable.Variance.CONTRAVARIANT
} else {
} else if (bounds.isNotEmpty()) {
variance = JavaType.GenericTypeVariable.Variance.COVARIANT
}
}
Expand Down

0 comments on commit 6b003c4

Please sign in to comment.