Kapt: Fix erasure() for executable types (KT-13629)

(cherry picked from commit 461c29d)
This commit is contained in:
Yan Zhulanow
2016-08-29 21:13:17 +03:00
committed by Yan Zhulanow
parent 941d016cef
commit 9127788f4a
5 changed files with 64 additions and 3 deletions
@@ -55,7 +55,18 @@ class JeMethodExecutableTypeMirror(
return typeParameters.map { JeTypeVariableType(PsiTypesUtil.getClassType(it), it) }
}
override fun toString() = (psi.containingClass?.qualifiedName?.let { it + "." } ?: "") + psi.name
override fun toString() = buildString {
val typeVariables = this@JeMethodExecutableTypeMirror.typeVariables
if (typeVariables.isNotEmpty()) {
append('<')
typeVariables.joinTo(this, ",")
append('>')
}
append('(')
parameterTypes.joinTo(this, ",")
append(')')
append((this@JeMethodExecutableTypeMirror as ExecutableType).returnType)
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
@@ -57,5 +57,7 @@ class JeTypeVariableType(
return psiType == (other as? JeTypeVariableType)?.psiType
}
override fun toString() = parameter.name ?: "<none>"
override fun hashCode() = psiType.hashCode()
}