From 6d58987538ed21b3ee3362cb6de3685df2021e45 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 2 Jul 2010 14:58:55 -0700 Subject: [PATCH] Walk (mut/constr stripped) TY_iso edges when boxed. Fault on non-boxed edges; they should not have made it past resolve. --- src/boot/me/trans.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index fdbe6f45ac6..d27b75b1967 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -2613,10 +2613,11 @@ let trans_visitor (curr_iso:Ast.ty_iso option) (t:Ast.ty) : Ast.ty = - match (curr_iso, t) with - (Some iso, Ast.TY_idx n) -> + match (curr_iso, strip_mutable_or_constrained_ty t) with + (_, Ast.TY_idx _) -> bug () "traversing raw TY_idx (non-box )edge" + | (Some iso, Ast.TY_box (Ast.TY_idx n)) -> Ast.TY_box (Ast.TY_iso { iso with Ast.iso_index = n }) - | (None, Ast.TY_idx _) -> + | (None, Ast.TY_box (Ast.TY_idx _)) -> bug () "TY_idx outside TY_iso" | _ -> t @@ -2624,8 +2625,8 @@ let trans_visitor (t:Ast.ty) (curr_iso:Ast.ty_iso option) : Ast.ty_iso option = - match t with - Ast.TY_iso tiso -> Some tiso + match strip_mutable_or_constrained_ty t with + Ast.TY_box (Ast.TY_iso tiso) -> Some tiso | _ -> curr_iso and mark_slot