-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Declarations for 2- and 3-argument GetMonData #1756
Conversation
Might I suggest |
Is this really an improvement? It seems more likely that someone would search for the definition of e.g. |
It's an improvement in the sense that it catches errors at compile time. Currently you can But to be clear, I mostly did this to see if it was possible, it's up to others to push for its inclusion or not. |
0bb76fe
to
b69ec96
Compare
Reviving this in response to rh-hideout#3170. Much less invasive than before, all calls (except one erroneous one in I think this change does achieve type-safety, e.g. the call in |
Could you put some similar comment in |
I've added some wording that I hope is useful :) Feel free to squash this if you merge it. |
* Type-safe GetMonData/GetBoxMonData * Comments
We definitely shouldn't name the functions
GetMonData
andGetMonData2
, so this can't be merged without somebody coming up with a better suggestion.Also, Rose on Discord suggested having something that wraps
GetMonData
for constantMON_DATA_*
arguments, which might be nice (although the ones that are used both withGetMonData
andGetMonData2
would end up being pretty ugly, so perhaps that's a nicer dream than reality).I think this should match, but just to be sure I've opened a PR so that the CI system can tell me if it doesn't.