Commit 6ff768bb authored by dbarbera's avatar dbarbera
Browse files

Check that mod/rem expressions are applied to integer types

parent 904d5b75
......@@ -1081,6 +1081,13 @@ def arithmetic_expression(root, context):
msg = 'Check that all your numerical data types have a range constraint'
errors.append(error(root, msg))
if root.type in (lexer.REM, lexer.MOD):
for ty in (expr.left.exprType, expr.right.exprType):
if not is_integer(ty):
msg = 'Mod/Rem expressions can only applied to Integer types'
errors.append(error(root, msg))
return expr, errors, warnings
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment