Skip to content

Support variants (types defined with '#type')#4

Open
bloeys wants to merge 1 commit intotsoding:masterfrom
bloeys:variant-support
Open

Support variants (types defined with '#type')#4
bloeys wants to merge 1 commit intotsoding:masterfrom
bloeys:variant-support

Conversation

@bloeys
Copy link

@bloeys bloeys commented Feb 5, 2026

Hey,

hope you are doing well!

This is a small PR to add support for type variants (e.g., Id :: #type,distinct int) when parsing or producing JSON.
I also added tests for this.

Btw I do not think variant_of can ever be null, but if yes, then we need to adjust the while loop to check info for null first.

Side note: I expect a loop similar to this approach for pointer handling should be a bit faster than the current dereference-by-recursion.

Thanks :)

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