[FE 1.0] Don't try to compute value parameters for variables while creating a flat signature for the overload resolution

^KT-50172 Fixed
This commit is contained in:
Victor Petukhov
2021-12-10 11:10:22 +03:00
committed by teamcity
parent c998582e13
commit e50e055eb4
10 changed files with 65 additions and 3 deletions
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.builtins.getValueParameterTypesFromCallableReflectio
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.MemberDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.descriptors.VariableDescriptor
import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor
import org.jetbrains.kotlin.resolve.calls.components.hasDefaultValue
import org.jetbrains.kotlin.types.KotlinType
@@ -28,9 +29,13 @@ fun <T> FlatSignature.Companion.createFromReflectionType(
// have transient receiver which is not the same in its signature
val receiver = descriptor.extensionReceiverParameter?.type
val contextReceiversTypes = descriptor.contextReceiverParameters.mapNotNull { it.type }
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(
receiver != null && !hasBoundExtensionReceiver
).map { it.type }
val parameters = if (descriptor is VariableDescriptor) {
emptyList()
} else {
reflectionType.getValueParameterTypesFromCallableReflectionType(
receiver != null && !hasBoundExtensionReceiver
).map { it.type }
}
return FlatSignature(
origin,