diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-24 19:49:10 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-24 19:49:10 +0800 |
commit | 6ed590cce27edbdcc13cdd478d8a68c81da44596 (patch) | |
tree | 4f1199797b6d27ccad637f64a016d1553d24b067 | |
parent | 9b7e985f35138594f1bc393a9b792113417fa8f5 (diff) | |
download | mrust-6ed590cce27edbdcc13cdd478d8a68c81da44596.tar.gz |
AST - More defensive `self: Box<Self>` code
-rw-r--r-- | src/ast/ast.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index 80182f85..70a61b32 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -320,6 +320,9 @@ Function::Function(Span sp, GenericParams params, TypeRef ret_type, Arglist args TU_IFLET( ::AST::Path::Class, e.path.m_class, Relative, pe,
if( pe.nodes.size() == 1 && pe.nodes.front().name() == "Box" )
{
+ if( pe.nodes.front().args().m_types.size() != 1 ) {
+ ERROR(sp, E0000, "Box takes 1 argument - " << ty);
+ }
// HACK: Assumes that the param is Self or equivalent
m_receiver = Receiver::Box;
}
|