Fix ultraLightClass method argument types erasure

Fix IdeRegression.testImplementingMap test
This commit is contained in:
Igor Yakovlev
2019-09-26 01:23:01 +03:00
parent c5fc55b84c
commit cef6b71897
3 changed files with 5 additions and 5 deletions
@@ -377,7 +377,7 @@ open class KtUltraLightClass(classOrObject: KtClassOrObject, internal val suppor
val bindingContext = typeReference.analyze() val bindingContext = typeReference.analyze()
val superClassDescriptor = CodegenUtil.getSuperClassBySuperTypeListEntry(superTypeEntry, bindingContext) ?: return val superClassDescriptor = CodegenUtil.getSuperClassBySuperTypeListEntry(superTypeEntry, bindingContext) ?: return
val delegationType = superTypeEntry.delegateExpression.kotlinType(bindingContext) ?: return val delegationType = superTypeEntry.delegateExpression.kotlinType(bindingContext)
for (delegate in DelegationResolver.getDelegates(classDescriptor, superClassDescriptor, delegationType).keys) { for (delegate in DelegationResolver.getDelegates(classDescriptor, superClassDescriptor, delegationType).keys) {
when (delegate) { when (delegate) {
@@ -94,15 +94,13 @@ internal abstract class KtUltraLightMethod(
abstract val methodDescriptor: FunctionDescriptor? abstract val methodDescriptor: FunctionDescriptor?
private val lazyTypeErasure = lazyPub { val checkNeedToErasureParametersTypes: Boolean by lazyPub {
methodDescriptor methodDescriptor
?.getSpecialSignatureInfo() ?.getSpecialSignatureInfo()
?.isObjectReplacedWithTypeParameter ?.let { it.valueParametersSignature !== null }
?: false ?: false
} }
val checkNeedToErasureParametersTypes: Boolean by lazyTypeErasure
override fun equals(other: Any?): Boolean = this === other override fun equals(other: Any?): Boolean = this === other
override fun hashCode(): Int = name.hashCode() override fun hashCode(): Int = name.hashCode()
@@ -18,5 +18,7 @@ abstract class SmartSet<T> private constructor() : AbstractMutableSet<T>() {
return true return true
} }
/* Should erasure T but UL classes does not support it in this case
override fun contains(element: T): Boolean = true override fun contains(element: T): Boolean = true
*/
} }