NI: Fix exception during callable references overload resolution
^KT-35847 Fixed
This commit is contained in:
+4
-1
@@ -55,7 +55,10 @@ class CallableReferenceOverloadConflictResolver(
|
||||
) {
|
||||
companion object {
|
||||
private fun createFlatSignature(candidate: CallableReferenceCandidate) =
|
||||
FlatSignature.createFromReflectionType(candidate, candidate.candidate, candidate.numDefaults, candidate.reflectionCandidateType)
|
||||
FlatSignature.createFromReflectionType(
|
||||
candidate, candidate.candidate, candidate.numDefaults, hasBoundExtensionReceiver = candidate.extensionReceiver != null,
|
||||
candidate.reflectionCandidateType
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class FlatSignature<out T> constructor(
|
||||
origin: T,
|
||||
descriptor: CallableDescriptor,
|
||||
numDefaults: Int,
|
||||
// Reflection type for callable references with bound receiver doesn't contain receiver type
|
||||
hasBoundExtensionReceiver: Boolean,
|
||||
reflectionType: UnwrappedType
|
||||
): FlatSignature<T> {
|
||||
// Note that receiver is taking over descriptor, not reflection type
|
||||
@@ -66,7 +68,9 @@ class FlatSignature<out T> constructor(
|
||||
// Plus, currently, receiver for reflection type is taking from *candidate*, see buildReflectionType, this candidate can
|
||||
// have transient receiver which is not the same in its signature
|
||||
val receiver = descriptor.extensionReceiverParameter?.type
|
||||
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(receiver == null).map { it.type }
|
||||
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(
|
||||
receiver != null && !hasBoundExtensionReceiver
|
||||
).map { it.type }
|
||||
|
||||
return FlatSignature(
|
||||
origin,
|
||||
|
||||
Reference in New Issue
Block a user