Skip to content

transpile: Translate enums with newtype structs#1620

Draft
Rua wants to merge 2 commits intoimmunant:masterfrom
Rua:enum-struct
Draft

transpile: Translate enums with newtype structs#1620
Rua wants to merge 2 commits intoimmunant:masterfrom
Rua:enum-struct

Conversation

@Rua
Copy link
Contributor

@Rua Rua commented Feb 25, 2026

@Rua Rua changed the title Translate enums with newtype structs transpile: Translate enums with newtype structs Feb 25, 2026
@Rua Rua force-pushed the enum-struct branch 6 times, most recently from 1fd4b08 to 908acb1 Compare February 25, 2026 16:43
@Rua
Copy link
Contributor Author

Rua commented Feb 25, 2026

It seems that the transpiler is generating working code, but then the refactorer is breaking the imports. I don't know if that's simply a bug in the refactorer, or something else.

Edit: wondering if the refactorer is not handling impl blocks properly, to support associated constants?

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Btw, #1623 should help with the error messages here, which I saw were atrocious (#1621).

@Rua
Copy link
Contributor Author

Rua commented Feb 27, 2026

The errors from refactor don't seem to have gone away. This PR hasn't changed anything about refactor, so is that a bug in the refactorer?

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

The errors from refactor don't seem to have gone away. This PR hasn't changed anything about refactor, so is that a bug in the refactorer?

Oh sorry, I meant #1623 should help make the error messages legible, but not fix them.

This is likely either a bug in the refactorer, or the refactorer is assuming something about what code the transpiler generates for enums and now can't handle a different translation of enums. If it's the latter, we should probably fix it here.

@Rua
Copy link
Contributor Author

Rua commented Feb 27, 2026

I've not looked at the refactorer code at all yet, so I wouldn't really know where to look for a possible cause. The CI error messages don't give much of a hint.

@kkysen
Copy link
Contributor

kkysen commented Feb 27, 2026

I've not looked at the refactorer code at all yet, so I wouldn't really know where to look for a possible cause. The CI error messages don't give much of a hint.

@ahomescu, do you have any idea maybe?

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.

Translate enums as newtype structs with associated constants?

2 participants