summaryrefslogtreecommitdiff
path: root/src/convert/ast_iterate.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-25 14:44:21 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-25 14:44:21 +0800
commit56601285b24450168e8b1853ae9c8b65f4576cb0 (patch)
treedaf1df0ad8cefef46696d7f9b1990b959d77f198 /src/convert/ast_iterate.cpp
parentb698207664e45b9b0bb9944b5c97084dfc593ed6 (diff)
downloadmrust-56601285b24450168e8b1853ae9c8b65f4576cb0.tar.gz
Fix pattern handling (not using Parse_Pattern for & patterns, inverted check for & pattern iterate)
Diffstat (limited to 'src/convert/ast_iterate.cpp')
-rw-r--r--src/convert/ast_iterate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/convert/ast_iterate.cpp b/src/convert/ast_iterate.cpp
index 153fc1c9..b474a755 100644
--- a/src/convert/ast_iterate.cpp
+++ b/src/convert/ast_iterate.cpp
@@ -76,8 +76,8 @@ void CASTIterator::handle_pattern(AST::Pattern& pat, const TypeRef& type_hint)
auto& v = pat.data().as_Ref();
if( type_hint.is_wildcard() )
handle_pattern(*v.sub, (const TypeRef&)TypeRef());
- else if( type_hint.is_reference() )
- throw ::std::runtime_error("Ref pattern on non-ref value");
+ else if( !type_hint.is_reference() )
+ throw ::std::runtime_error( FMT("Ref pattern on non-ref value: " << type_hint) );
else
handle_pattern(*v.sub, type_hint.sub_types()[0]);
break; }