Skip to content

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

Description

@LeNitrous

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions