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

LGI throws an error when passing nil to a bitflag parameter #329

Open
vtrlx opened this issue Dec 4, 2024 · 0 comments · May be fixed by #330
Open

LGI throws an error when passing nil to a bitflag parameter #329

vtrlx opened this issue Dec 4, 2024 · 0 comments · May be fixed by #330

Comments

@vtrlx
Copy link

vtrlx commented Dec 4, 2024

I have a habit of not passing all parameters into function calls if I don't strictly need them. For GObject functions which explicitly accept NULL, that's not a problem. It only becomes an issue when I try to opt out of passing a bit flags parameter, as I expect LGI to default to using 0. In these cases, I currently need to explicitly pass 0 or a flag which resolves to 0 to achieve this. Given Lua's dynamically typed nature, this feels like an opportunity to give the user some leeway.

vtrlx added a commit to vtrlx/lgi that referenced this issue Dec 4, 2024
This allows the user to opt out of passing flags into functions when
there are none to specify. While libraries in statically typed languages
expect users to pass in an explicit _NONE flag, Lua's ability to pass a
variable number of parameters could easily be interpreted as explicitly
not giving any flags when none are passed.

Fixes lgi-devs#329
@vtrlx vtrlx linked a pull request Dec 4, 2024 that will close this issue
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 a pull request may close this issue.

1 participant