GLib.strcmp doesn't support nullable strings
GLib's g_strcmp0
has args that are flagged as nullable, but Vala's GLib.strcmp
is marked as a CompareFunc<string>
function, rather than a CompareFunc<string?>
function.
void main () {
string? s = "foo";
GLib.strcmp (s, "foo");
}
$ valac -C --enable-experimental-non-null test.vala
test.vala:3.15-3.15: error: Argument 1: Cannot convert from `unowned string?' to `unowned string'
GLib.strcmp (s, "foo");
^
Compilation failed: 1 error(s), 0 warning(s)
Edited by Rico Tzschichholz