diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-01-05 15:09:30 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-01-05 15:09:30 +0800 |
commit | 4ead75dea44e61502c8257161ff6b86fcc835adf (patch) | |
tree | fa8478f2d58ea6def7976ce9f2225f9ff701a8af /src/ast | |
parent | c0267e165eca49583ac6ba7c3b48ba68ec4eee49 (diff) | |
download | mrust-4ead75dea44e61502c8257161ff6b86fcc835adf.tar.gz |
Resolve Use - Handle partial shadowing of items/imports
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/path.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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(); |