Skip to content

Conversation

morrisonlevi
Copy link

Without the fix, you get something stupid like this:

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef NonNull MyId;

void takes_id(MyId id);

void takes_unit_ptr(void *id);

I'm not sure if there's a smarter fix but I've hit this issue several times. It may need to apply to more types. The only one I can think of that might be a candidate is Box but I haven't seen Box<()> in the wild myself so I didn't include it.

@morrisonlevi morrisonlevi changed the title fix: NonNull<()> doesn't lower to void * fix: NonNull<()> doesn't lower to void * Aug 20, 2025
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 this pull request may close these issues.

1 participant