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

Generating a transparent struct of a boolean byte generates C# code with a missing parenthesis #577

Open
LeNitrous opened this issue Oct 23, 2024 · 0 comments

Comments

@LeNitrous
Copy link

LeNitrous commented Oct 23, 2024

Description:

Generating a byte boolean with --with-transparent-struct MyBoolean=byte;Boolean generates a helper struct with a line with a missing parenthesis.

Minimal reproduction:

repro.h

#include <stdint.h>

typedef uint8_t MyBoolean;

typedef MyBoolean (*MyFunction)(void* userdata);

repro.rsp

--file
repro.h
--output
./
--namespace
Repro
--config
multi-file
preview-codegen
exclude-fnptr-codegen
generate-helper-types
--with-transparent-struct
MyBoolean=byte;Boolean

Output:

public static implicit operator MyBoolean(bool value) => new MyBoolean((byte)(value ? 1u : 0u);
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

1 participant