diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-11 18:07:29 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-11 18:07:29 +0800 |
commit | d1edb6f8e5b9085ca3ad36d4c85d3bab810b19bc (patch) | |
tree | c3785ba24388db7cb9b649b250c397ff927a378b /src | |
parent | 2cc7375dc027ed3d9ff72ad79d5c4a78acaf9abf (diff) | |
download | mrust-d1edb6f8e5b9085ca3ad36d4c85d3bab810b19bc.tar.gz |
Resolve Absolute - Defensive asserts
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/absolute.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index b2966022..d6159dd3 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -990,6 +990,7 @@ void Resolve_Absolute_Path_BindAbsolute(Context& context, const Span& sp, Contex return ; ), (Trait, + assert( e.trait_ ); auto trait_path = ::AST::Path(name_ref.path); if( !n.args().is_empty() ) { trait_path.nodes().back().args() = mv$(n.args()); @@ -1025,6 +1026,7 @@ void Resolve_Absolute_Path_BindAbsolute(Context& context, const Span& sp, Contex TODO(sp, "Replace path component with new path - " << path << "[.."<<i<<"] with " << name_ref.path); } else { + assert( e.enum_ ); const auto& last_node = path_abs.nodes.back(); for( const auto& var : e.enum_->variants() ) { if( var.m_name == last_node.name() ) { |