diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-13 13:57:43 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-13 13:57:43 +0800 |
commit | 2dd9abe0cd5e9c2b6f8235af697332e063efc9aa (patch) | |
tree | 0ff8f71b001e0c133f3642c06932f915784a5f0b /src/resolve/absolute.cpp | |
parent | b8ffa877896d09fa13a0c89aae41d9e9a5b736bb (diff) | |
download | mrust-2dd9abe0cd5e9c2b6f8235af697332e063efc9aa.tar.gz |
HIR - Fix name resolution of `Type::method` to search inherent then traits
Diffstat (limited to 'src/resolve/absolute.cpp')
-rw-r--r-- | src/resolve/absolute.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index 62b528a4..3e1e2ff4 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -363,7 +363,7 @@ struct Context ), (ConcreteSelf, if( ( mode == LookupMode::Type || mode == LookupMode::Namespace ) && name == "Self" ) { - return ::AST::Path( ::AST::Path::TagUfcs(), *e, ::std::vector< ::AST::PathNode>() ); + return ::AST::Path( ::AST::Path::TagUfcs(), *e, ::AST::Path(), ::std::vector< ::AST::PathNode>() ); } ), (VarBlock, @@ -411,7 +411,7 @@ struct Context auto ct = coretype_fromstring(name); if( ct != CORETYPE_INVAL ) { - return ::AST::Path( ::AST::Path::TagUfcs(), TypeRef(Span("-",0,0,0,0), ct), ::std::vector< ::AST::PathNode>() ); + return ::AST::Path( ::AST::Path::TagUfcs(), TypeRef(Span("-",0,0,0,0), ct), ::AST::Path(), ::std::vector< ::AST::PathNode>() ); } return AST::Path(); @@ -521,7 +521,7 @@ void Resolve_Absolute_Path_BindUFCS(Context& context, const Span& sp, Context::L } if( ufcs.nodes.size() == 0 ) { - if( mode == Context::LookupMode::Type && ! ufcs.trait ) { + if( mode == Context::LookupMode::Type && ufcs.trait && *ufcs.trait == ::AST::Path() ) { return ; } @@ -909,7 +909,7 @@ void Resolve_Absolute_Type(Context& context, TypeRef& type) (Path, Resolve_Absolute_Path(context, type.span(), Context::LookupMode::Type, e.path); TU_IFLET(::AST::Path::Class, e.path.m_class, UFCS, ufcs, - if( ufcs.nodes.size() == 0 && ! ufcs.trait ) { + if( ufcs.nodes.size() == 0 /*&& ufcs.trait && *ufcs.trait == ::AST::Path()*/ ) { auto ty = mv$(*ufcs.type); type = mv$(ty); return ; |