From 1ea188d13b8ea8d977c82ff0060b6420d8c81ffc Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 27 Aug 2017 18:44:56 +0800 Subject: Lower HIR - Hack around 'Self' replacement --- src/hir/from_ast.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index b4ea38e6..3e366d8f 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -552,6 +552,21 @@ return rv; ) else { + if(const auto* e = path.m_class.opt_UFCS()) { + DEBUG(path); + if( !e->type ) { + } + //else if( e->trait ) { + //} + else if( ! e->nodes.empty() ) { + } + else if( !e->type->m_data.is_Path() ) { + } + else { + // HACK: `Self` replacement + return LowerHIR_GenericPath(sp, e->type->m_data.as_Path().path, false); + } + } BUG(sp, "Encountered non-Absolute path when creating ::HIR::GenericPath - " << path); } } -- cgit v1.2.3