[Commonizer] Don't serialize kotlin/Any? as the single type parameter upper bound
This commit is contained in:
+13
-7
@@ -14,15 +14,21 @@ import org.jetbrains.kotlin.descriptors.commonizer.utils.compactMap
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.utils.intern
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.types.typeUtil.isNullableAny
|
||||
|
||||
object CirTypeParameterFactory {
|
||||
fun create(source: TypeParameterDescriptor): CirTypeParameter = create(
|
||||
annotations = source.annotations.compactMap(CirAnnotationFactory::create),
|
||||
name = source.name.intern(),
|
||||
isReified = source.isReified,
|
||||
variance = source.variance,
|
||||
upperBounds = source.upperBounds.compactMap(CirTypeFactory::create)
|
||||
)
|
||||
fun create(source: TypeParameterDescriptor): CirTypeParameter {
|
||||
val upperBounds = source.upperBounds
|
||||
val filteredUpperBounds = if (upperBounds.singleOrNull()?.isNullableAny() == true) emptyList() else upperBounds
|
||||
|
||||
return create(
|
||||
annotations = source.annotations.compactMap(CirAnnotationFactory::create),
|
||||
name = source.name.intern(),
|
||||
isReified = source.isReified,
|
||||
variance = source.variance,
|
||||
upperBounds = filteredUpperBounds.compactMap(CirTypeFactory::create)
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun create(
|
||||
|
||||
Reference in New Issue
Block a user