Don't apply Java defaulting nullability annotations rules to unbounded wildcards
^KT-47396 Fixed
This commit is contained in:
committed by
teamcityserver
parent
99491014e4
commit
f9cb0d61a8
+5
-3
@@ -358,7 +358,8 @@ class SignatureEnhancement(
|
||||
?: computeNullabilityInfoInTheAbsenceOfExplicitAnnotation(
|
||||
nullabilityFromBoundsForTypeBasedOnTypeParameter,
|
||||
defaultTypeQualifier,
|
||||
typeParameterForArgument
|
||||
typeParameterForArgument,
|
||||
isFromStarProjection
|
||||
)
|
||||
|
||||
val isNotNullTypeParameter =
|
||||
@@ -385,7 +386,8 @@ class SignatureEnhancement(
|
||||
private fun computeNullabilityInfoInTheAbsenceOfExplicitAnnotation(
|
||||
nullabilityFromBoundsForTypeBasedOnTypeParameter: NullabilityQualifierWithMigrationStatus?,
|
||||
defaultTypeQualifier: JavaDefaultQualifiers?,
|
||||
typeParameterForArgument: TypeParameterDescriptor?
|
||||
typeParameterForArgument: TypeParameterDescriptor?,
|
||||
isFromStarProjection: Boolean
|
||||
): NullabilityQualifierWithMigrationStatus? {
|
||||
|
||||
val result =
|
||||
@@ -406,7 +408,7 @@ class SignatureEnhancement(
|
||||
)
|
||||
}
|
||||
|
||||
if (result == null) return boundsFromTypeParameterForArgument
|
||||
if (result == null || isFromStarProjection) return boundsFromTypeParameterForArgument
|
||||
|
||||
return mostSpecific(boundsFromTypeParameterForArgument, result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user