This is because an EnumValue object does not have a type reference.
https://bugzilla.gnome.org/show_bug.cgi?id=780050
enums/flags.vala \
enums/bug673879.vala \
enums/bug763831.vala \
+ enums/bug780050.vala \
structs/structs.vala \
structs/gvalue.vala \
structs/bug530605.vala \
--- /dev/null
+enum Bar {
+ FOO
+}
+
+namespace Foo {
+ Bar bar = Bar.FOO;
+}
+
+void main () {
+}
public override bool is_non_null () {
var c = symbol_reference as Constant;
if (c != null) {
- return !c.type_reference.nullable;
+ return (c is EnumValue || !c.type_reference.nullable);
} else {
return false;
}