summaryrefslogtreecommitdiff
path: root/src/convert/ast_iterate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert/ast_iterate.cpp')
-rw-r--r--src/convert/ast_iterate.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/convert/ast_iterate.cpp b/src/convert/ast_iterate.cpp
index 4d147c70..10eb4342 100644
--- a/src/convert/ast_iterate.cpp
+++ b/src/convert/ast_iterate.cpp
@@ -66,6 +66,14 @@ void CASTIterator::handle_pattern(AST::Pattern& pat, const TypeRef& type_hint)
case AST::Pattern::ANY:
// Wildcard, nothing to do
break;
+ case AST::Pattern::REF:
+ if( type_hint.is_wildcard() )
+ handle_pattern(pat.sub_patterns()[0], (const TypeRef&)TypeRef());
+ else if( type_hint.is_reference() )
+ throw ::std::runtime_error("Ref pattern on non-ref value");
+ else
+ handle_pattern(pat.sub_patterns()[0], type_hint.sub_types()[0]);
+ break;
case AST::Pattern::MAYBE_BIND:
throw ::std::runtime_error("Calling CASTIterator::handle_pattern on MAYBE_BIND, not valid");
case AST::Pattern::VALUE: