"Let type implement interface": don't suggest same type #KT-25928 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
2d2f1125a9
commit
6fbf6b0a93
@@ -44,6 +44,7 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.KotlinTypeFactory
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.typeUtil.*
|
||||
import java.util.*
|
||||
|
||||
@@ -120,7 +121,9 @@ class QuickFixFactoryForTypeMismatchError : KotlinIntentionActionsFactory() {
|
||||
val expressionTypeDeclaration = expressionType.constructor.declarationDescriptor?.let {
|
||||
DescriptorToSourceUtils.descriptorToDeclaration(it)
|
||||
} as? KtClassOrObject
|
||||
expressionTypeDeclaration?.let { actions.add(LetImplementInterfaceFix(it, expectedType, expressionType)) }
|
||||
if (expressionTypeDeclaration != null && expectedType != TypeUtils.makeNotNullable(expressionType)) {
|
||||
actions.add(LetImplementInterfaceFix(expressionTypeDeclaration, expectedType, expressionType))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user