Fix incorrect environment entry
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 14 Sep 2018 15:45:13 +0000 (11:45 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 14 Sep 2018 15:45:13 +0000 (11:45 -0400)
should be a value, not type

compiler/src/lib/tiger/tiger_semant.ml

index f653e16..082760f 100644 (file)
@@ -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
This page took 0.026693 seconds and 4 git commands to generate.