diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-15 17:46:58 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-15 17:46:58 +0200 |
commit | 866258f688d781f3536892b8f93abdd3112198ec (patch) | |
tree | be391041c9d45994f4fae2e463405dd21cb29611 /vala | |
parent | 5ae9d6b888f988dc83ba8b99d3447dc5b70f6baa (diff) | |
download | vala-866258f688d781f3536892b8f93abdd3112198ec.tar.gz |
vala: Fully qualify member-access when using-directive was used to resolve
Fixes https://gitlab.gnome.org/GNOME/vala/issues/57
Diffstat (limited to 'vala')
-rw-r--r-- | vala/valamemberaccess.vala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index db022fefd..02d3b50ad 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -337,6 +337,17 @@ public class Vala.MemberAccess : Expression { Report.error (source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (member_name, symbol_reference.get_full_name (), local_sym.get_full_name ())); return false; } + + // Transform to fully qualified member access + unowned Symbol? inner_sym = local_sym.parent_symbol; + unowned MemberAccess? inner_ma = this; + while (inner_sym != null && inner_sym.name != null) { + inner_ma.inner = new MemberAccess (null, inner_sym.name, source_reference); + inner_ma = (MemberAccess) inner_ma.inner; + inner_sym = inner_sym.parent_symbol; + } + inner.check (context); + symbol_reference = local_sym; } } |