From 12bd4e9c45199ad4865d6842e6556897aee855a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Tue, 12 Apr 2011 16:02:03 +0200 Subject: [PATCH] Types. --- compiler/global/types.ml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/global/types.ml b/compiler/global/types.ml index a5a4545..5e0d2b2 100644 --- a/compiler/global/types.ml +++ b/compiler/global/types.ml @@ -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 }