diff options
author | John Hodge <tpg@mutabah.net> | 2015-02-01 21:10:18 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-02-01 21:10:18 +0800 |
commit | 414883e7b61d14edb242d320dcf0e5dea3e75e85 (patch) | |
tree | 26940136306759abea6f877a03fb7c7b9020eeab /src/ast/path.hpp | |
parent | 76f199888f65fd21ffdae7c3518748098fdc0726 (diff) | |
download | mrust-414883e7b61d14edb242d320dcf0e5dea3e75e85.tar.gz |
Hacking away at type propagation
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r-- | src/ast/path.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp index cfdf16c2..4ff128c6 100644 --- a/src/ast/path.hpp +++ b/src/ast/path.hpp @@ -178,8 +178,8 @@ public: ::std::vector<PathNode>& nodes() { return m_nodes; } const ::std::vector<PathNode>& nodes() const { return m_nodes; } - PathNode& operator[](size_t idx) { return m_nodes[idx]; } - const PathNode& operator[](size_t idx) const { return m_nodes[idx]; } + PathNode& operator[](int idx) { if(idx>=0) return m_nodes[idx]; else return m_nodes[size()+idx]; } + const PathNode& operator[](int idx) const { if(idx>=0) return m_nodes[idx]; else return m_nodes[size()+idx]; } bool operator==(const Path& x) const; |