|
|
@@ -212,6 +212,12 @@ let rec typecheck node =
|
|
|
| Const (FloatVal value, ann) ->
|
|
|
Const (FloatVal value, Type Float :: ann)
|
|
|
|
|
|
+ (* Extern arrays variables are transformed to imported functions, so the
|
|
|
+ * pointer cannot be passed *)
|
|
|
+ | VarUse (GlobalDec (ArrayDims _, _, _), None, _) ->
|
|
|
+ raise (NodeError (node, "imported array pointers may only be \
|
|
|
+ dereferenced, not used directly"))
|
|
|
+
|
|
|
(* Variables inherit the type of their declaration *)
|
|
|
| VarUse (dec, None, ann) ->
|
|
|
VarUse (dec, None, Type (typeof dec) :: ann)
|