Commit ec843751 authored by dbarbera's avatar dbarbera
Browse files

Added type analysis for append expressions

parent a04ca83b
......@@ -1151,7 +1151,11 @@ def append_expression(root, context):
''' Append expression analysis '''
expr, errors, warnings = binary_expression(root, context)
# TODO: Check types
for bty in (find_basic_type(expr.left.exprType), find_basic_type(expr.right.exprType)):
if bty.kind != 'SequenceOfType' and not is_string(bty):
msg = 'Append can only be applied to types SequenceOf or String'
errors.append(error(root, msg))
expr.exprType = expr.left.exprType
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