diff options
author | John Hodge <tpg@mutabah.net> | 2016-02-25 14:38:59 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-02-25 14:38:59 +0800 |
commit | c43fd3adac502ab3ebb5f548dd09c0823af486e5 (patch) | |
tree | cce6397eb14467e6715cf76dad8cf4c6b6d8a28e | |
parent | e3cbce4d476085e3e569a78616602b6ecdb2f1b9 (diff) | |
download | mrust-c43fd3adac502ab3ebb5f548dd09c0823af486e5.tar.gz |
Convert - Defer struct pattern typecheck further
-rw-r--r-- | src/convert/ast_iterate.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/convert/ast_iterate.cpp b/src/convert/ast_iterate.cpp index 142064e6..3bee3234 100644 --- a/src/convert/ast_iterate.cpp +++ b/src/convert/ast_iterate.cpp @@ -192,7 +192,14 @@ void CASTIterator::handle_pattern(AST::Pattern& pat, const TypeRef& type_hint) } else { - throw ::std::runtime_error("TODO: Struct typecheck/iterate"); + auto& path = type_hint.m_data.as_Path().path; + if( path.is_bound() ) { + throw ::std::runtime_error("TODO: Typecheck/iterate struct pattern (with known type)"); + } + else { + for( auto& sp : v.sub_patterns ) + handle_pattern(sp.second, (const TypeRef&)TypeRef()); + } } }), (StructTuple, { |