From ad4b6b707dedcdc779435b16081ed0445f71ff05 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 Mar 2015 23:02:21 +0800 Subject: Handling for 'T::method()' (where T is a type param) --- src/ast/path.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ast/path.hpp') 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(); -- cgit v1.2.3