Change Signature: Use target declaration as a context for types

#KT-22387 Fixed
This commit is contained in:
Alexey Sedunov
2018-05-24 21:22:08 +03:00
parent 3245148206
commit 6e25db990d
@@ -402,7 +402,7 @@ class KotlinChangeSignatureDialog(
companion object {
private fun createParametersInfoModel(descriptor: KotlinMethodDescriptor, defaultValueContext: PsiElement): KotlinCallableParameterTableModel {
val typeContext = getTypeCodeFragmentContext(defaultValueContext)
val typeContext = getTypeCodeFragmentContext(descriptor.baseDeclaration)
return when (descriptor.kind) {
KotlinMethodDescriptor.Kind.FUNCTION -> KotlinFunctionParameterTableModel(descriptor, typeContext, defaultValueContext)
KotlinMethodDescriptor.Kind.PRIMARY_CONSTRUCTOR -> KotlinPrimaryConstructorParameterTableModel(descriptor, typeContext, defaultValueContext)