GObject property not initialized when enum default value is nonzero
If a GObject property is of an enum type with a non-zero default value, then the property is not initialized to that value.
Example:
[CCode (default_value = "INSERT_TEXT_FORMAT_INSERT_TEXT")]
enum InsertTextFormat {
INSERT_TEXT = 1,
SNIPPET = 2
}
class CompletionItem : Object {
public InsertTextFormat insert_text_format { get; set; }
}
void main () {
var item = new CompletionItem ();
print ("item.insert_text_format = %s\n", item.insert_text_format.to_string ());
}
% vala enum-default-nonzero.vala
item.insert_text_format = (null)
Edited by Princeton Ferro