summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-29 23:02:21 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-29 23:02:21 +0800
commitad4b6b707dedcdc779435b16081ed0445f71ff05 (patch)
tree429096a6f984897d1488c62d93144a013c75a04d /src/ast/path.hpp
parente60aa50103d9b24819f3dc26c783c2237f873664 (diff)
downloadmrust-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.hpp7
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();