WIP type-checking -- check array subscript access
[tiger.ml.git] / compiler / src / lib / tiger / tiger_env_type.ml
index bb8cdd6..4d99a0d 100644 (file)
@@ -97,6 +97,18 @@ let if_record t ~f ~otherwise =
   | Array  _ ->
       otherwise ()
 
+let if_array t ~f ~otherwise =
+  match t with
+  | Array {ty=t; _} ->
+      f t
+  | Unit
+  | Int
+  | String
+  | Name _
+  | Nil
+  | Record _ ->
+      otherwise ()
+
 let to_string = function
   | Unit               -> "unit"
   | Nil                -> "nil"
This page took 0.022685 seconds and 4 git commands to generate.