[vala/0.40] vala: Mark tranformed member-access as qualified



commit ad76d599b859f2208a9e7d5b07925ca6c1cf5abe
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Aug 5 17:45:39 2020 +0200

    vala: Mark tranformed member-access as qualified
    
    Regression of 866258f688d781f3536892b8f93abdd3112198ec
    
    See https://gitlab.gnome.org/GNOME/vala/issues/57

 tests/Makefile.am                                    |  1 +
 .../member-access-transformed-qualified.vala         | 20 ++++++++++++++++++++
 vala/valamemberaccess.vala                           |  1 +
 3 files changed, 22 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9be7483fc..970bbe133 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -759,6 +759,7 @@ TESTS = \
        semantic/member-access-protected-invalid.test \
        semantic/member-access-undefined.test \
        semantic/member-access-static-with-instance.vala \
+       semantic/member-access-transformed-qualified.vala \
        semantic/method-abstract.test \
        semantic/method-abstract-body.test \
        semantic/method-async-ref-parameter.test \
diff --git a/tests/semantic/member-access-transformed-qualified.vala 
b/tests/semantic/member-access-transformed-qualified.vala
new file mode 100644
index 000000000..f8c273d08
--- /dev/null
+++ b/tests/semantic/member-access-transformed-qualified.vala
@@ -0,0 +1,20 @@
+using Foo.Bar;
+using Foo.Manam;
+
+namespace Foo.Bar {
+       public int bar = 23;
+}
+
+namespace Foo.Manam {
+       public class Foo {
+               public static void faz () {
+                       bar = 42;
+               }
+       }
+}
+
+void main () {
+       assert (bar == 23);
+       Foo.Manam.Foo.faz ();
+       assert (bar == 42);
+}
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index deb702a2a..869e0282c 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -320,6 +320,7 @@ public class Vala.MemberAccess : Expression {
                                                        inner_ma = (MemberAccess) inner_ma.inner;
                                                        inner_sym = inner_sym.parent_symbol;
                                                }
+                                               inner_ma.qualified = true;
                                                inner.check (context);
 
                                                symbol_reference = local_sym;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]