From 4ead75dea44e61502c8257161ff6b86fcc835adf Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 5 Jan 2019 15:09:30 +0800 Subject: Resolve Use - Handle partial shadowing of items/imports --- src/ast/path.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ast') diff --git a/src/ast/path.hpp b/src/ast/path.hpp index 89804b61..18ebea49 100644 --- a/src/ast/path.hpp +++ b/src/ast/path.hpp @@ -245,6 +245,14 @@ public: bool has_binding() const { return !value.is_Unbound() || !type.is_Unbound() || !macro.is_Unbound(); } + void merge_from(const Bindings& x) { + if(value.is_Unbound()) + value = x.value.clone(); + if(type.is_Unbound()) + type = x.type.clone(); + if(macro.is_Unbound()) + macro = x.macro.clone(); + } } m_bindings; virtual ~Path(); -- cgit v1.2.3