diff --git a/src/nagini_translation/resources/bool.sil b/src/nagini_translation/resources/bool.sil index 6b61505a..377d4a29 100644 --- a/src/nagini_translation/resources/bool.sil +++ b/src/nagini_translation/resources/bool.sil @@ -223,7 +223,7 @@ function int___mul__(self: Int, other: Int): Int function int___pow__(self: Int, other: Int): Int decreases _ - requires other >= 0 + requires @error("** is currently only supported for non-negative exponents.")(other >= 0) { ___pow(self, other) } diff --git a/src/nagini_translation/translators/expression.py b/src/nagini_translation/translators/expression.py index 555f8f72..c9214860 100644 --- a/src/nagini_translation/translators/expression.py +++ b/src/nagini_translation/translators/expression.py @@ -994,6 +994,8 @@ def translate_operator(self, left: Expr, right: Expr, left_type: PythonType, if left_type == right_type or isinstance(right_type, TypeVar): call_stmt, call = self.get_func_or_method_call(left_type, LEFT_OPERATOR_FUNCTIONS[type(node.op)], [left, right], [left_type, right_type], node, ctx) + if call is None: + raise UnsupportedException(node, "Unsupported binary operator") return stmt + call_stmt, call else: