ClangSharp icon indicating copy to clipboard operation
ClangSharp copied to clipboard

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

Open LeNitrous opened this issue 1 year ago • 0 comments

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);

LeNitrous avatar Oct 23 '24 23:10 LeNitrous