K1: add deprecation warning for property/field pair with different types

#KT-57905 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-04-18 18:45:24 +02:00
committed by Space Team
parent 2100f08655
commit 41e551e321
13 changed files with 163 additions and 2 deletions
@@ -44,6 +44,22 @@ fun FunctionDescriptor.computeJvmDescriptor(withReturnType: Boolean = true, with
}
}
fun PropertyDescriptor.computeJvmDescriptorWithoutName() = buildString {
append("(")
extensionReceiverParameter?.let {
appendErasedType(it.type)
}
append(")")
if (hasVoidReturnType(this@computeJvmDescriptorWithoutName)) {
append("V")
} else {
appendErasedType(returnType!!)
}
}
// Boxing is only necessary for 'remove(E): Boolean' of a MutableCollection<Int> implementation
// Otherwise this method might clash with 'remove(I): E' defined in the java.util.List JDK interface (mapped to kotlin 'removeAt')
fun forceSingleValueParameterBoxing(f: CallableDescriptor): Boolean {