lgi-devs / lgi-devs/lgi

LGI throws an error when passing nil to a bitflag parameter

Open
#329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
491
Forks
81
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating LGI's handling of bitflag parameters and reproduce the issue with a GObject function that accepts NULL for the flags argument. Confirm the expected behavior for a nil value and add coverage showing that it is treated like 0 without changing explicit flag handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.