summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/expr_cs.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 721891c7..c3e85ae5 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -11,6 +11,7 @@
#include <hir/visitor.hpp>
#include <algorithm> // std::find_if
+#include <hir_typeck/static.hpp>
#include "helpers.hpp"
#include "expr_visit.hpp"
@@ -4132,7 +4133,8 @@ void Context::handle_pattern(const Span& sp, ::HIR::Pattern& pat, const ::HIR::T
}
}
- // If there's no dereferences done, then
+ // If there's no dereferences done, then add a possible unsize type
+ // TODO: If the pattern is a String or ByteString value, then permit a single deref
if( n_deref == 0 )
{
const ::HIR::TypeRef& possible_type = get_possible_type(context, pattern);
@@ -8543,5 +8545,18 @@ void Typecheck_Code_CS(const typeck::ModuleState& ms, t_args& args, const ::HIR:
ExprVisitor_Apply visitor { context };
visitor.visit_node_ptr( expr );
}
+
+ {
+ StaticTraitResolve static_resolve(ms.m_crate);
+ if( ms.m_impl_generics )
+ {
+ static_resolve.set_impl_generics_raw(*ms.m_impl_generics);
+ }
+ if( ms.m_item_generics )
+ {
+ static_resolve.set_item_generics_raw(*ms.m_item_generics);
+ }
+ Typecheck_Expressions_ValidateOne(static_resolve, args, result_type, expr);
+ }
}