Fix AssertionError on overloading function with property in actual class
#KT-22352 Fixed
This commit is contained in:
+5
@@ -161,6 +161,8 @@ object ExpectedActualResolver {
|
||||
sealed class Incompatible(val reason: String?, val kind: IncompatibilityKind = IncompatibilityKind.WEAK) : Compatibility() {
|
||||
// Callables
|
||||
|
||||
object CallableKind : Incompatible("callable kinds are different (function vs property)", IncompatibilityKind.STRONG)
|
||||
|
||||
object ParameterShape : Incompatible("parameter shapes are different (extension vs non-extension)", IncompatibilityKind.STRONG)
|
||||
|
||||
object ParameterCount : Incompatible("number of value parameters is different", IncompatibilityKind.STRONG)
|
||||
@@ -227,6 +229,9 @@ object ExpectedActualResolver {
|
||||
"This function should be invoked only for declarations in the same kind of container (both members or both top level): $a, $b"
|
||||
}
|
||||
|
||||
if (a is FunctionDescriptor && b !is FunctionDescriptor ||
|
||||
a !is FunctionDescriptor && b is FunctionDescriptor) return Incompatible.CallableKind
|
||||
|
||||
val aExtensionReceiver = a.extensionReceiverParameter
|
||||
val bExtensionReceiver = b.extensionReceiverParameter
|
||||
if ((aExtensionReceiver != null) != (bExtensionReceiver != null)) return Incompatible.ParameterShape
|
||||
|
||||
Reference in New Issue
Block a user