Skip to content

[Klib] Rework serialization logic for IrTypeAlias#6500

Open
Miłosz Piekutowski (mpiekutowski) wants to merge 4 commits into
masterfrom
rr/milo/KT-86632/fix
Open

[Klib] Rework serialization logic for IrTypeAlias#6500
Miłosz Piekutowski (mpiekutowski) wants to merge 4 commits into
masterfrom
rr/milo/KT-86632/fix

Conversation

@mpiekutowski

@mpiekutowski Miłosz Piekutowski (mpiekutowski) commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@kotlin-safemerge

kotlin-safemerge Bot commented Jul 2, 2026

Copy link
Copy Markdown

Drop serialization and deserialization of `IrTypeAlias`, keep the proto
field for backward compatibility.

^KT-86632 Fixed
Comment on lines 1562 to 1565
is IrTypeAlias ->
proto.irTypeAlias = serializeIrTypeAlias(declaration, parent)
error("IrTypeAlias must not be serialized")
else ->
TODO("Declaration serialization not supported yet: $declaration")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably merge the branch for is IrTypeAlias with else and replace TODO("Declaration serialization not supported yet: $declaration") by error("Serialization of ${declaration::class.java} is not supported: $declaration")

@ddolovov

Copy link
Copy Markdown
Contributor

It makes sense to add a flag to IrDeserializationSettings to control whether TA can be deserialized. By default this flag should be false, but we will have to turn it true in the KLIB tool to dump IR TAs if they happen to be in old KLIBs.

* As a much simpler approach, fake overrides in local classes are not dumped both before and after serialization.
*/
true
} else if (declaration is IrTypeAlias) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (declaration is IrTypeAlias && !isAfterDeserialization) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants