diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-29 23:02:21 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-29 23:02:21 +0800 |
commit | ad4b6b707dedcdc779435b16081ed0445f71ff05 (patch) | |
tree | 429096a6f984897d1488c62d93144a013c75a04d /src/ast/path.hpp | |
parent | e60aa50103d9b24819f3dc26c783c2237f873664 (diff) | |
download | mrust-ad4b6b707dedcdc779435b16081ed0445f71ff05.tar.gz |
Handling for 'T::method()' (where T is a type param)
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r-- | src/ast/path.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp index 027f8f35..1e70389d 100644 --- a/src/ast/path.hpp +++ b/src/ast/path.hpp @@ -215,7 +215,12 @@ public: } /// Grab the args from the first node of b, and add the rest to the end of the path void add_tailing(const Path& b) { - m_nodes.back().args() = b[0].args(); + if( m_nodes.size() > 0 ) + m_nodes.back().args() = b[0].args(); + else if( b[0].args().size() > 0 ) + throw ::std::runtime_error("add_tail to empty path, but generics in source"); + else + ; for(unsigned int i = 1; i < b.m_nodes.size(); i ++) m_nodes.push_back(b.m_nodes[i]); m_binding = PathBinding(); |