summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge (sonata) <tpg@mutabah.net>2015-01-20 21:30:26 +0800
committerJohn Hodge (sonata) <tpg@mutabah.net>2015-01-20 21:30:26 +0800
commit2b9a03f6b71446dceb12f5d097f066e3c9354210 (patch)
tree4fb6f405b20aa52f161c80c5e6d994d48a574e1f /src/ast/path.hpp
parentdcb89ac3be47b79af382fff4b10a25004072fe98 (diff)
downloadmrust-2b9a03f6b71446dceb12f5d097f066e3c9354210.tar.gz
Type merging hacked in
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r--src/ast/path.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index 02e028d7..4576ceec 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -165,9 +165,13 @@ public:
_(Static, static, STATIC)
#undef _
const Enum& bound_enum() const {
- assert(m_binding_type == ENUM || m_binding_type == ENUM_VAR);
+ assert(m_binding_type == ENUM || m_binding_type == ENUM_VAR); // Kinda evil, given that it has its own union entry
return *m_binding.enum_;
}
+ const unsigned int bound_idx() const {
+ assert(m_binding_type == ENUM_VAR);
+ return m_binding.enumvar.idx;
+ }
::std::vector<PathNode>& nodes() { return m_nodes; }
const ::std::vector<PathNode>& nodes() const { return m_nodes; }