semantic analysis fails with GLib.GenericSetIter.next_value
void main (string[] args) {
var unique_args = new GenericSet<string> (GLib.str_hash, GLib.str_equal);
foreach (var arg in args)
unique_args.add (arg);
foreach (var unique in unique_args)
print (unique);
}
% valac genericset.vala
genericset.vala:7.28-7.38: error: return type of `GLib.GenericSetIter.next_value' must be nullable
foreach (var unique in unique_args)
^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Even though we have in glib-2.0.vapi
:
// ...
[Version (since = "2.32")]
[CCode (cname = "GHashTableIter", lower_case_cprefix = "g_hash_table_iter_", has_type_id = false)]
public struct GenericSetIter<T> {
[CCode (cname = "_vala_hash_set_next_value")]
public unowned T? next_value () {
void* vi = &this;
GLib.HashTableIter<unowned T,T>* htp = vi;
unowned T? value;
return htp->next (out value, null) ? value : null;
}
public void remove ();
}
// ...