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

Generated code incorrect for DBus structs in 0.0.12 #6

Closed
Ace4896 opened this issue Nov 18, 2023 · 2 comments
Closed

Generated code incorrect for DBus structs in 0.0.12 #6

Ace4896 opened this issue Nov 18, 2023 · 2 comments

Comments

@Ace4896
Copy link

Ace4896 commented Nov 18, 2023

Hi, after upgrading from 0.0.11 to 0.0.12, I found that the generated code for structs seem to be incorrect. I've created a minimal repro here - master branch is on 0.0.11 and generator-0.0.12 branch on 0.0.12.

It seems to be missing out the last field in structs, like these methods from ReaderExtensions:

// Should be (ObjectPath, byte[], byte[], string)
public static (ObjectPath, byte[], byte[]) ReadStruct_roayaysz(this ref Reader reader)
{
    reader.AlignStruct();
    return ValueTuple.Create(reader.ReadObjectPath(), reader.ReadArray_ay(), reader.ReadArray_ay());
}

// Should be (ObjectPath, byte[], byte[])
public static (ObjectPath, byte[]) ReadStruct_roayayz(this ref Reader reader)
{
    reader.AlignStruct();
    return ValueTuple.Create(reader.ReadObjectPath(), reader.ReadArray_ay());
}
@affederaffe
Copy link
Owner

Seems like I messed with the SignatureReader which resulted in discarding the last element of structs. Should be fixed with 0.0.13, thanks!

@Ace4896
Copy link
Author

Ace4896 commented Nov 18, 2023

Can confirm that it's fixed in 0.0.13, thanks for the quick update!

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

No branches or pull requests

2 participants