Cannot zero initialize structs with non-null members
@williamhua
Submitted by William Hua Link to original bug (#786943)
Description
The example from https://valadoc.org/glib-2.0/GLib.OptionContext.html doesn't compile when --enable-experimental-non-null is passed. I think it's because zero-initialization of structs is not possible when the types of the fields are not explicitly marked nullable.
test.vala:35.5-35.8: error: Expected initializer of type `string' but got `null'
{ null }
^^^^
test.vala:35.3-35.3: error: expression type not allowed as initializer
{ null }
^
The only way to make the example work is by disabling the non-null support :(
See also
Edited by Corentin Noël