This commit is contained in:
Léonard Gérard 2011-04-12 16:02:03 +02:00
parent 6adb45c3ad
commit 12bd4e9c45

View file

@ -31,13 +31,11 @@ and ty =
| Tprod of ty list (** Product type used for tuples *)
| Tid of type_name (** Usable type_name are alias or pervasives {bool,int,float} (see [Initial]) *)
| Tarray of ty * static_exp (** [base_type] * [size] *) (* TODO obc : array of prod ?? nonono *)
| Tmutable of ty (* TODO obc : do not hack it here *)
| Tunit
| Tinvalid
let invalid_type = Tprod [] (** Invalid type given to untyped expression etc. *)
let invalid_type = Tinvalid (** Invalid type given to untyped expression etc. *)
let prod = function
| [] -> Tunit
| [ty] -> ty
| ty_list -> Tprod ty_list
@ -45,9 +43,7 @@ let unprod = function
| Tprod l -> l
| t -> [t]
(** DO NOT use this after the typing, since it could give invalid_type *)
let mk_static_exp ?(loc = no_location) ?(ty = invalid_type) desc =
let mk_static_exp ?(loc = no_location) ty desc = (*note ~ty: replace as first arg*)
{ se_desc = desc; se_ty = ty; se_loc = loc }