Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Make sure all Flag parameters are nullable #21

Open
nlbuescher opened this issue Oct 26, 2020 · 0 comments
Open

Make sure all Flag parameters are nullable #21

nlbuescher opened this issue Oct 26, 2020 · 0 comments

Comments

@nlbuescher
Copy link
Collaborator

Ran into this problem just now: function like ImGui.treeNodeEx which optionally take a Flag<ImGuiTreeNodeFlags> don't currently support sending nullable flags:

val flags = (if (selected == current) ImGuiTreeNodeFlags.Selected else null) or ImGuiTreeNodeFlags.OpenOnArrow
ImGui.treeNodeEx(current.uuid(), flags, "Some node") // compile error: required Flag<ImGuiTreeNodeFlags>, found Flag<ImGuiTreeNodeFlags>?

there are a few workarounds, but since 0 is a valid Flag value, null should be accepted anywhere

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant