diff options
| author | Patrick Walton <[email protected]> | 2010-11-19 17:41:17 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-11-19 17:41:44 -0800 |
| commit | c410d685294e73a944f3e7cfe403f415a0cff849 (patch) | |
| tree | 5b4e7296273f3200c6bc6963b0b3acdb5bf65b69 /src/boot | |
| parent | Parse type items, nil types, named types. Fix some parser bugs. Enable arith-... (diff) | |
| download | rust-c410d685294e73a944f3e7cfe403f415a0cff849.tar.xz rust-c410d685294e73a944f3e7cfe403f415a0cff849.zip | |
rustboot: Say when a binary operator is unimplemented rather than asserting in trans
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/me/trans.ml | 9 |
1 files changed, 7 insertions, 2 deletions
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) -> |