[KLIB] Fix DNN type key in serializer

This commit is contained in:
Roman Artemev
2022-02-09 19:58:14 +03:00
committed by Space
parent 1fd2b9c9d9
commit 412194dd75
@@ -464,20 +464,23 @@ open class IrFileSerializer(
) )
private val IrType.toIrTypeKey: IrTypeKey private val IrType.toIrTypeKey: IrTypeKey
get() = IrTypeKey( get() {
kind = when (this) { var type = this
is IrDefinitelyNotNullType -> IrTypeKind.DEFINITELY_NOT_NULL return IrTypeKey(
is IrSimpleType -> IrTypeKind.SIMPLE kind = when (this) {
is IrDynamicType -> IrTypeKind.DYNAMIC is IrDefinitelyNotNullType -> IrTypeKind.DEFINITELY_NOT_NULL.also { type = original }
is IrErrorType -> IrTypeKind.ERROR is IrSimpleType -> IrTypeKind.SIMPLE
else -> error("Unexpected IrType kind: $this") is IrDynamicType -> IrTypeKind.DYNAMIC
}, is IrErrorType -> IrTypeKind.ERROR
classifier = this.classifierOrNull, else -> error("Unexpected IrType kind: $this")
hasQuestionMark = (this as? IrSimpleType)?.hasQuestionMark, },
arguments = (this as? IrSimpleType)?.arguments?.map { it.toIrTypeArgumentKey }, classifier = type.classifierOrNull,
annotations = this.annotations, hasQuestionMark = (type as? IrSimpleType)?.hasQuestionMark,
abbreviation = (this as? IrSimpleType)?.abbreviation arguments = (type as? IrSimpleType)?.arguments?.map { it.toIrTypeArgumentKey },
) annotations = type.annotations,
abbreviation = (type as? IrSimpleType)?.abbreviation
)
}
private val IrTypeArgument.toIrTypeArgumentKey: IrTypeArgumentKey private val IrTypeArgument.toIrTypeArgumentKey: IrTypeArgumentKey
get() = IrTypeArgumentKey( get() = IrTypeArgumentKey(