From 3044ae80284fb958051ffd2926fcbff470ff8591 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Thu, 15 Jan 2015 11:44:12 +0800 Subject: Type alias bound to path, considering removing std hack and implementing AST read --- src/ast/path.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ast/path.cpp') diff --git a/src/ast/path.cpp b/src/ast/path.cpp index e6700696..636c4166 100644 --- a/src/ast/path.cpp +++ b/src/ast/path.cpp @@ -103,7 +103,14 @@ void Path::resolve(const Crate& root_crate) throw ParseError::Generic("Param count mismatch when referencing type alias"); // Make a copy of the path, replace params with it, then replace *this? // - Maybe leave that up to other code? - throw ParseError::Todo("Path::resolve() type alias"); + if( is_last ) { + m_binding_type = ALIAS; + m_binding.alias = &it->data; + return ; + } + else { + throw ParseError::Todo("Path::resolve() type method"); + } } } -- cgit v1.2.3