Provide migration of Any functions via super in abstract case
Related to KT-38078
This commit is contained in:
+2
-3
@@ -812,9 +812,8 @@ internal object CheckSuperExpressionCallPart : ResolutionPart() {
|
||||
if (callComponents.statelessCallbacks.isSuperExpression(resolvedCall.dispatchReceiverArgument)) {
|
||||
if (candidateDescriptor is CallableMemberDescriptor) {
|
||||
if (candidateDescriptor.modality == Modality.ABSTRACT) {
|
||||
addDiagnostic(AbstractSuperCall)
|
||||
}
|
||||
if (candidateDescriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE &&
|
||||
addDiagnostic(AbstractSuperCall(resolvedCall.dispatchReceiverArgument!!))
|
||||
} else if (candidateDescriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE &&
|
||||
candidateDescriptor.overriddenDescriptors.size > 1
|
||||
) {
|
||||
if (candidateDescriptor.overriddenDescriptors.firstOrNull { !it.isInsideInterface }?.modality == Modality.ABSTRACT) {
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ object InstantiationOfAbstractClass : KotlinCallDiagnostic(RUNTIME_ERROR) {
|
||||
override fun report(reporter: DiagnosticReporter) = reporter.onCall(this)
|
||||
}
|
||||
|
||||
object AbstractSuperCall : KotlinCallDiagnostic(RUNTIME_ERROR) {
|
||||
class AbstractSuperCall(val receiver: SimpleKotlinCallArgument) : KotlinCallDiagnostic(RUNTIME_ERROR) {
|
||||
override fun report(reporter: DiagnosticReporter) {
|
||||
reporter.onCall(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user