summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/expr_cs.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index dd31dbe0..437050ad 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -1807,6 +1807,11 @@ namespace {
return ;
}
+ // TODO: Check if this is actually a coercion.
+ if( tgt_ty.m_data.is_Path() || tgt_ty.m_data.is_Generic() ) {
+ ERROR(sp, E0000, "Non-scalar cast to " << this->context.m_ivars.fmt_type(tgt_ty) << " from " << this->context.m_ivars.fmt_type(src_ty));
+ }
+
TU_MATCH( ::HIR::TypeRef::Data, (tgt_ty.m_data), (e),
(Infer,
// Can't know anything
@@ -1821,10 +1826,10 @@ namespace {
this->m_completed = true;
),
(Path,
- ERROR(sp, E0000, "Non-scalar cast to " << this->context.m_ivars.fmt_type(tgt_ty));
+ BUG(sp, "_Cast Path");
),
(Generic,
- ERROR(sp, E0000, "Non-scalar cast to " << this->context.m_ivars.fmt_type(tgt_ty));
+ BUG(sp, "_Cast Generic");
),
(TraitObject,
ERROR(sp, E0000, "Non-scalar cast to " << this->context.m_ivars.fmt_type(tgt_ty));