From 774d7839d7302e6ebd9b0209ef3d64446048c5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dybiec?= Date: Sun, 25 Nov 2018 04:40:20 +0100 Subject: Fix topdown strategy for add --- source/mod_student/typechecker.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/mod_student/typechecker.ml b/source/mod_student/typechecker.ml index 95e9157..2b380b0 100644 --- a/source/mod_student/typechecker.ml +++ b/source/mod_student/typechecker.ml @@ -191,10 +191,10 @@ module Make() = struct * elementy kontra typ elementu tablicy `tp` *) | EXPR_Struct {elements; _}, TP_Array tp -> List.iter (check_expression env tp) elements - | EXPR_Binop {op=BINOP_And; lhs; rhs;_}, TP_Int -> + | EXPR_Binop {op=BINOP_Add; lhs; rhs;_}, TP_Int -> check_expression env TP_Int lhs; check_expression env TP_Int rhs - | EXPR_Binop {op=BINOP_And; lhs; rhs;_}, (TP_Array tp as t) -> + | EXPR_Binop {op=BINOP_Add; lhs; rhs;_}, (TP_Array tp as t) -> check_expression env t lhs; check_expression env t rhs | EXPR_Index {expr;index;loc; _}, tp -> -- cgit v1.2.3