summaryrefslogtreecommitdiff
path: root/src/mir/check.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir/check.cpp')
-rw-r--r--src/mir/check.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mir/check.cpp b/src/mir/check.cpp
index 54b831df..4b9dfd8b 100644
--- a/src/mir/check.cpp
+++ b/src/mir/check.cpp
@@ -689,7 +689,7 @@ void MIR_Validate(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
// TODO: Check suitability of source type (COMPLEX)
),
(BinOp,
- #if 0
+ /*
::HIR::TypeRef tmp_l, tmp_r;
const auto& ty_l = state.get_lvalue_type(tmp_l, e.val_l);
const auto& ty_r = state.get_lvalue_type(tmp_r, e.val_r);
@@ -704,7 +704,7 @@ void MIR_Validate(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
if( ty_l != ty_r )
MIR_BUG(state, "Type mismatch in binop, " << ty_l << " != " << ty_r);
}
- #endif
+ */
// TODO: Check return type
),
(UniOp,
@@ -721,8 +721,9 @@ void MIR_Validate(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
ity_p = &*ty.m_data.as_Borrow().inner;
else if( ty.m_data.is_Pointer() )
ity_p = &*ty.m_data.as_Pointer().inner;
- else
+ else {
MIR_BUG(state, "DstMeta requires a &-ptr as input, got " << ty);
+ }
const auto& ity = *ity_p;
if( ity.m_data.is_Generic() )
;
@@ -754,8 +755,9 @@ void MIR_Validate(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
ity_p = &*ty.m_data.as_Borrow().inner;
else if( ty.m_data.is_Pointer() )
ity_p = &*ty.m_data.as_Pointer().inner;
- else
+ else {
MIR_BUG(state, "DstPtr requires a &-ptr as input, got " << ty);
+ }
const auto& ity = *ity_p;
if( ity.m_data.is_Slice() )
;
@@ -781,8 +783,9 @@ void MIR_Validate(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
ity_p = &*te->inner;
else if( const auto* te = ty.m_data.opt_Pointer() )
ity_p = &*te->inner;
- else
+ else {
MIR_BUG(state, "DstMeta requires a pointer as output, got " << ty);
+ }
assert(ity_p);
auto meta = get_metadata_type(state, *ity_p);
if( meta == ::HIR::TypeRef() )