[KLIB] Fix DNN type key in serializer
This commit is contained in:
+17
-14
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user