Skip to content

Add union support for windows-rdl#3867

Merged
riverar merged 4 commits intomasterfrom
rafael/union
Jan 31, 2026
Merged

Add union support for windows-rdl#3867
riverar merged 4 commits intomasterfrom
rafael/union

Conversation

@riverar
Copy link
Copy Markdown
Collaborator

@riverar riverar commented Jan 30, 2026

Building on #3861, this update adds end-to-end support for unions.

An example in .rdl:

mod Test {
    union Name {
        a1: u8,
        a2: u16,
        a3: f32,
    }
}

The reader will encode this interface into a .winmd file as such:

.class public explicit ansi sealed Test.Name
  extends [mscorlib]System.ValueType
{
  .field [0] public uint8 a1
  .field [0] public uint16 a2
  .field [0] public float32 a3
}

Comment thread crates/libs/rdl/src/writer/struct.rs Outdated
Copy link
Copy Markdown
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

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

That's excellent - thank you!

@riverar riverar merged commit 632fb82 into master Jan 31, 2026
32 checks passed
@riverar riverar deleted the rafael/union branch January 31, 2026 01:10
@kennykerr kennykerr mentioned this pull request Feb 17, 2026
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