summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/enums/bug780050.vala10
-rw-r--r--vala/valamemberaccess.vala2
3 files changed, 12 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 426570c5a..add13c5a8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -112,6 +112,7 @@ TESTS = \
enums/flags.vala \
enums/bug673879.vala \
enums/bug763831.vala \
+ enums/bug780050.vala \
structs/structs.vala \
structs/gvalue.vala \
structs/bug530605.vala \
diff --git a/tests/enums/bug780050.vala b/tests/enums/bug780050.vala
new file mode 100644
index 000000000..b69f7c099
--- /dev/null
+++ b/tests/enums/bug780050.vala
@@ -0,0 +1,10 @@
+enum Bar {
+ FOO
+}
+
+namespace Foo {
+ Bar bar = Bar.FOO;
+}
+
+void main () {
+}
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 23ca8d68b..c00f5fca5 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -187,7 +187,7 @@ public class Vala.MemberAccess : Expression {
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;
}