FE: do not enhance ? into ? extends @NotNull Object in JSR-305

This is already done in jspecify and makes more sense anyway.
This commit is contained in:
pyos
2021-09-07 11:17:30 +02:00
committed by Victor Petukhov
parent 34ae5387b3
commit f793afbfea
8 changed files with 18 additions and 24 deletions
@@ -143,7 +143,7 @@ private fun ConeKotlinType.enhanceInflexibleType(
val mergedArguments = Array(typeArguments.size) { enhancedArguments[it] ?: typeArguments[it] }
val mergedAttributes = if (shouldAddAttribute) attributes + CompilerConeAttributes.EnhancedNullability else attributes
val enhancedType = enhancedTag.constructType(mergedArguments, enhancedNullability, mergedAttributes)
return if (effectiveQualifiers.isNotNullTypeParameter)
return if (effectiveQualifiers.definitelyNotNull)
ConeDefinitelyNotNullType.create(enhancedType, session.typeContext) ?: enhancedType
else
enhancedType