Skip to content

Fix invalid enum base types being generated in C# source#1899

Merged
tritao merged 3 commits intomono:mainfrom
duckdoom5:fix/invalid-cs-enum-base-type
Feb 6, 2025
Merged

Fix invalid enum base types being generated in C# source#1899
tritao merged 3 commits intomono:mainfrom
duckdoom5:fix/invalid-cs-enum-base-type

Conversation

@duckdoom5
Copy link
Copy Markdown
Contributor

To give an example of this going wrong. C++ allows bool as an enum base type.

@tritao
Copy link
Copy Markdown
Collaborator

tritao commented Feb 3, 2025

This should probably be done as a pass, so it works across all backends.

I don't think we have an appropriate pass at the moment, so either a new one, or maybe re-use
https://github.com/mono/CppSharp/blob/main/src/Generator/Passes/CheckFlagEnumsPass.cs (and rename to CheckEnumsPass)?

@tritao
Copy link
Copy Markdown
Collaborator

tritao commented Feb 3, 2025

And can you add a test please?

@duckdoom5 duckdoom5 mentioned this pull request Feb 3, 2025
5 tasks
@duckdoom5
Copy link
Copy Markdown
Contributor Author

Sure can do ! :)

@duckdoom5 duckdoom5 force-pushed the fix/invalid-cs-enum-base-type branch 3 times, most recently from a3af59f to 3ade6b5 Compare February 4, 2025 16:32
@duckdoom5 duckdoom5 force-pushed the fix/invalid-cs-enum-base-type branch from 3ade6b5 to 31ff92c Compare February 5, 2025 19:39
@duckdoom5
Copy link
Copy Markdown
Contributor Author

@tritao Can you run the failed job again? Yesterday evening there was something wrong with the ssl server causing the download to fail occasionally

@tritao tritao merged commit 18d817f into mono:main Feb 6, 2025
7 checks passed
@duckdoom5 duckdoom5 deleted the fix/invalid-cs-enum-base-type branch February 6, 2025 12:32
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