From 2122b59ea2c5fa83fb7b3be7365c8e661b18f28e Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 1 Jul 2010 13:20:57 -0700 Subject: Some work on teaching trans to differentiate between auto-deref and explicit-deref contexts. --- src/boot/me/semant.ml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/boot/me/semant.ml') diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 182c6811..21e55193 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -1065,14 +1065,19 @@ let check_concrete params thing = else bug () "unhandled parametric binding" ;; -let rec simplified_ty (t:Ast.ty) : Ast.ty = +let rec strip_mutable_or_constrained_ty (t:Ast.ty) : Ast.ty = match t with - Ast.TY_box t - | Ast.TY_mutable t - | Ast.TY_constrained (t, _) -> simplified_ty t + Ast.TY_mutable t + | Ast.TY_constrained (t, _) -> strip_mutable_or_constrained_ty t | _ -> t ;; +let rec simplified_ty (t:Ast.ty) : Ast.ty = + match strip_mutable_or_constrained_ty t with + Ast.TY_box t -> simplified_ty t + | t -> t +;; + let rec project_type (base_ty:Ast.ty) (comp:Ast.lval_component) -- cgit v1.2.3