Override/Implement Members: Support all nullability annotations respected by the Kotlin compiler
#KT-12704 Fixed #KT-15583 Fixed
This commit is contained in:
@@ -31,10 +31,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
|
||||
import org.jetbrains.kotlin.types.typeUtil.substitute
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
import org.jetbrains.kotlin.types.typeUtil.*
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.singletonList
|
||||
|
||||
@@ -68,7 +65,7 @@ private fun KotlinType.approximateNonDynamicFlexibleTypes(
|
||||
|
||||
approximation = approximation.approximateNonDynamicFlexibleTypes()
|
||||
|
||||
approximation = if (isAnnotatedNotNull()) approximation.makeNullableAsSpecified(false) else approximation
|
||||
approximation = if (nullability() == TypeNullability.NOT_NULL) approximation.makeNullableAsSpecified(false) else approximation
|
||||
|
||||
if (approximation.isMarkedNullable && !flexible.lowerBound.isMarkedNullable && TypeUtils.isTypeParameter(approximation) && TypeUtils.hasNullableSuperType(approximation)) {
|
||||
approximation = approximation.makeNullableAsSpecified(false)
|
||||
|
||||
Reference in New Issue
Block a user