Commit f27bbac0 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Basic type check in range expression

parent 1a60340a
......@@ -4180,6 +4180,12 @@ def for_range(root, context):
result['stop'] = expr[0]
else:
errors.append('Incorrect range expression')
# Basic check that range element basic types are all integers
for each in expr:
basic = find_basic_type(each.exprType)
if not basic.kind.startswith("Integer"):
errors.append(u"Expression {} is not evaluated to integer"
.format(each.inputString))
return result, errors, warnings
......
Markdown is supported
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