Allow type variable fixation into intersection type if it isn't meaningless (i.e. has one or more final classes, or two or more open classes)
^KT-46186 Fixed
This commit is contained in:
@@ -15,6 +15,7 @@ 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
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.CapturedType
|
||||
import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.*
|
||||
@@ -237,6 +238,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return declarationDescriptor is ClassDescriptor
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.isInterface(): Boolean {
|
||||
require(this is TypeConstructor, this::errorMessage)
|
||||
return DescriptorUtils.isInterface(declarationDescriptor)
|
||||
}
|
||||
|
||||
override fun TypeConstructorMarker.isCommonFinalClassConstructor(): Boolean {
|
||||
require(this is TypeConstructor, this::errorMessage)
|
||||
val classDescriptor = declarationDescriptor as? ClassDescriptor ?: return false
|
||||
|
||||
Reference in New Issue
Block a user