X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_semant.ml;h=082760f8ecca4faa3375e1b2fe3ccb2fa873109e;hp=f653e162997edbf72841a880ec30170bcaacc1a1;hb=85e08b692d47a78c082e2dd6472062446c2d700b;hpb=155073e21824373c21dacbd75a61623c9d37fff2 diff --git a/compiler/src/lib/tiger/tiger_semant.ml b/compiler/src/lib/tiger/tiger_semant.ml index f653e16..082760f 100644 --- a/compiler/src/lib/tiger/tiger_semant.ml +++ b/compiler/src/lib/tiger/tiger_semant.ml @@ -132,7 +132,8 @@ end = struct check_int (trexp lo) ~pos; check_int (trexp hi) ~pos; (* Only care if a type-error is raised *) - ignore (transExp ~env:(Env.set_typ env var Type.Int) body); + let env = Env.set_val env var (Value.Var {ty = Type.Int}) in + ignore (transExp ~env body); return_unit | A.BreakExp _ -> return_unit