From c410d685294e73a944f3e7cfe403f415a0cff849 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 19 Nov 2010 17:41:17 -0800 Subject: rustboot: Say when a binary operator is unimplemented rather than asserting in trans --- src/boot/me/trans.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/boot') diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index c3d5240b..58cccb99 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -2578,8 +2578,13 @@ let trans_visitor in match expr with Ast.EXPR_binary (binop, a, b) -> - assert (is_prim_type (simplified_ty (atom_type cx a))); - assert (is_prim_type (simplified_ty (atom_type cx b))); + if not (is_prim_type (simplified_ty (atom_type cx a))) || + not (is_prim_type (simplified_ty (atom_type cx b))) then + unimpl None "application of binary operator %a to operands of \ + type %s and %s" + Ast.sprintf_binop binop + (pretty_ty_str cx (Ast.sprintf_ty ()) (atom_type cx a)) + (pretty_ty_str cx (Ast.sprintf_ty ()) (atom_type cx b)); trans_binary binop (trans_atom a) (trans_atom b) | Ast.EXPR_unary (unop, a) -> -- cgit v1.2.3