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

Document bitmask C# API difference #9995

Closed
wants to merge 2 commits into from

Conversation

LemmaEOF
Copy link

I spent a good couple hours today beating my head against an inscrutable C# compile error tonight that ended up being because of some methods that use bitmasks as an argument wanting a uint in C# instead of an int in the type signature, something that doesn't appear on GDScript-focused documentation as a difference between signed and unsigned ints doesn't exist in GDScript. Due to C# type coercion in most cases this is niche enough that not many people will run into it, but I want to prevent other people running into this wall as well, so I've put a quick note of bitmasks using uint for method overrides in the C# API differences doc.

@AThousandShips AThousandShips requested a review from a team September 24, 2024 15:16
@AThousandShips AThousandShips added enhancement topic:dotnet area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Sep 24, 2024
@paulloz
Copy link
Member

paulloz commented Sep 25, 2024

Hello, and thank you for your contribution.
This is not something specific to bitmasks, it is a more general thing about the GDScript types not always aligning with C# types (e.g. int in the documentation might mean long in C#, or float might mean double). We are currently working on a dedicated C# documentation. That will IMHO solve this issue, since it'll always refer to the actual C# API types. In the meantime, it's probably fine to add a note somewhere to explain this, but I'm not sure that we need to focus on bitmasks. I'm also not a big fan of wording errors as being "confusing" in our own documentation.

@LemmaEOF
Copy link
Author

Makes sense to me! The C# docs will definitely solve the issue. I can look into adding a note directly on things that use uint possibly, but that's a matter for another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants