[JVM IR] Make upper bounds check recursive for ieee Equals.
Fixes KT-44402
This commit is contained in:
committed by
Alexander Udalov
parent
566f97ae3e
commit
965c118521
@@ -81,7 +81,9 @@ fun KotlinType.isPrimitiveNumberOrNullableType(): Boolean =
|
||||
fun KotlinType.isTypeParameter(): Boolean = TypeUtils.isTypeParameter(this)
|
||||
|
||||
fun KotlinType.upperBoundedByPrimitiveNumberOrNullableType(): Boolean =
|
||||
TypeUtils.getTypeParameterDescriptorOrNull(this)?.upperBounds?.any { it.isPrimitiveNumberOrNullableType() } == true
|
||||
TypeUtils.getTypeParameterDescriptorOrNull(this)?.upperBounds?.any {
|
||||
it.isPrimitiveNumberOrNullableType() || it.upperBoundedByPrimitiveNumberOrNullableType()
|
||||
} == true
|
||||
|
||||
fun KotlinType.isInterface(): Boolean = (constructor.declarationDescriptor as? ClassDescriptor)?.kind == ClassKind.INTERFACE
|
||||
fun KotlinType.isEnum(): Boolean = (constructor.declarationDescriptor as? ClassDescriptor)?.kind == ClassKind.ENUM_CLASS
|
||||
@@ -306,4 +308,4 @@ private fun NewCapturedType.unCaptureTopLevelType(): UnwrappedType {
|
||||
return constructor.projection.type.unwrap()
|
||||
}
|
||||
|
||||
fun KotlinType.shouldBeSubstituted() = contains { it is StubType || it.constructor is TypeVariableTypeConstructorMarker }
|
||||
fun KotlinType.shouldBeSubstituted() = contains { it is StubType || it.constructor is TypeVariableTypeConstructorMarker }
|
||||
|
||||
Reference in New Issue
Block a user