Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defining Union inside a dataclass #1362

Merged
merged 4 commits into from
Dec 26, 2022

Conversation

czgdp1807
Copy link
Collaborator

No description provided.

@czgdp1807 czgdp1807 marked this pull request as ready for review December 15, 2022 12:00
x: i32
y: i64
b: B
c: i32
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! While at this, given the new StructStaticMember, can you also please add a test for:

@dataclass
class A:
    @dataclass
    class B(Union):
        x: i32
        y: i64
    b: B
    c: i32

Essentially a "struct in struct"? We will need it too sooner or later, so now is the time to make sure it works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Please let me know if there is anything else to do here.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think this is fine. I haven't checked the verify() changes in detail, hopefully they are correct.

@czgdp1807 czgdp1807 enabled auto-merge (squash) December 26, 2022 10:37
@czgdp1807 czgdp1807 merged commit e6cff59 into lcompilers:main Dec 26, 2022
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.

None yet

2 participants