[vala/0.40] vala: Fully qualify member-access when using-directive was used to resolve
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] vala: Fully qualify member-access when using-directive was used to resolve
- Date: Thu, 30 Jul 2020 11:02:58 +0000 (UTC)
commit 2f3a9539814e6a926bab178db0880fc0a7eacf98
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Jul 15 17:46:58 2020 +0200
vala: Fully qualify member-access when using-directive was used to resolve
Fixes https://gitlab.gnome.org/GNOME/vala/issues/57
vala/valamemberaccess.vala | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 9bc492948..bd56184a5 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -311,6 +311,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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]