Approximate definitely not-null types for type parameter's types if they are already not-null (has not-null upper bounds)
^KT-44440 Fixed
This commit is contained in:
@@ -137,6 +137,8 @@ interface TypeSystemInferenceExtensionContext : TypeSystemContext, TypeSystemBui
|
||||
|
||||
fun TypeConstructorMarker.isCapturedTypeConstructor(): Boolean
|
||||
|
||||
fun TypeConstructorMarker.isTypeParameterTypeConstructor(): Boolean
|
||||
|
||||
fun Collection<KotlinTypeMarker>.singleBestRepresentative(): KotlinTypeMarker?
|
||||
|
||||
fun KotlinTypeMarker.isUnit(): Boolean
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.annotations.BuiltInAnnotationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.impl.AbstractTypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
@@ -573,6 +574,10 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return this is NewCapturedTypeConstructor
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.isTypeParameterTypeConstructor(): Boolean {
|
||||
return this is AbstractTypeConstructor && this.declarationDescriptor is AbstractTypeParameterDescriptor
|
||||
}
|
||||
|
||||
override fun arrayType(componentType: KotlinTypeMarker): SimpleTypeMarker {
|
||||
require(componentType is KotlinType, this::errorMessage)
|
||||
return builtIns.getArrayType(Variance.INVARIANT, componentType)
|
||||
|
||||
Reference in New Issue
Block a user