summaryrefslogtreecommitdiff
path: root/src/hir/type.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-20 09:31:04 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-20 09:31:04 +0800
commiteed9342461dccc53a699260f65379688172971e7 (patch)
tree716e8c5d0a2adfcd8e373ad3e5a4762666c12a31 /src/hir/type.cpp
parent4c13ad983753f29a63fffbf9fccba3287099e4f7 (diff)
downloadmrust-eed9342461dccc53a699260f65379688172971e7.tar.gz
HIR Typecheck Expr - Fix bug in array unsize
Diffstat (limited to 'src/hir/type.cpp')
-rw-r--r--src/hir/type.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp
index b6e930da..76154008 100644
--- a/src/hir/type.cpp
+++ b/src/hir/type.cpp
@@ -843,6 +843,17 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x
return Compare::Unequal;
}
)
+ else TU_IFLET(::HIR::TypeRef::Data, right.m_data, Infer, le,
+ switch(le.ty_class)
+ {
+ case ::HIR::InferClass::None:
+ case ::HIR::InferClass::Diverge:
+ case ::HIR::InferClass::Integer:
+ return Compare::Fuzzy;
+ case ::HIR::InferClass::Float:
+ return Compare::Unequal;
+ }
+ )
else {
return Compare::Unequal;
}
@@ -857,6 +868,17 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x
return Compare::Unequal;
}
)
+ else TU_IFLET(::HIR::TypeRef::Data, right.m_data, Infer, le,
+ switch(le.ty_class)
+ {
+ case ::HIR::InferClass::None:
+ case ::HIR::InferClass::Diverge:
+ case ::HIR::InferClass::Float:
+ return Compare::Fuzzy;
+ case ::HIR::InferClass::Integer:
+ return Compare::Unequal;
+ }
+ )
else {
return Compare::Unequal;
}