berdon / zig-json

Simple zig JSON parsing library with a focus on friendly API.
MIT License
27 stars 9 forks source link

Compilation Fails When *OrNull functions are used #7

Open tekktonic opened 6 months ago

tekktonic commented 6 months ago

Not sure if this is an issue with zig 0.12 which I can fix before merge or if it's also present in the current master branch since it's late and I don't have 0.11 on me at the moment:

/home/danny/.cache/zig/p/1220e495c9aa58599de08b6a08447515d84d7dc885319af52d5939924d3dd260e9ef/src/main.zig:383:82: error: optional type '?main.JsonValue.JsonValue__union_6442' does not support field access
/home/danny/.cache/zig/p/1220e495c9aa58599de08b6a08447515d84d7dc885319af52d5939924d3dd260e9ef/src/main.zig:383:82: note: consider using '.?', 'orelse', or 'if'

It should be an easy fix either way, just not something I'm getting to tonight. Just adding .?s should work.