From dbfd05155be05e357a895c11281a1c505423973d Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Tue, 6 Aug 2024 12:41:30 +0200 Subject: [PATCH] Fix: Expr.map was missing types in logs --- compiler/shared_ast/expr.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/shared_ast/expr.ml b/compiler/shared_ast/expr.ml index c7ce9dec..ef29b9bb 100644 --- a/compiler/shared_ast/expr.ml +++ b/compiler/shared_ast/expr.ml @@ -293,6 +293,10 @@ let map | ELit l -> elit l m | EApp { f = e1; args; tys } -> eapp ~f:(f e1) ~args:(List.map f args) ~tys:(List.map typ tys) m + | EAppOp { op = Op.Log (VarDef vd, infos), pos; tys; args } -> + let log_typ = Mark.remove (typ (Mark.add Pos.no_pos vd.log_typ)) in + let op = fop (Op.Log (VarDef { vd with log_typ }, infos), pos) in + eappop ~op ~tys:(List.map typ tys) ~args:(List.map f args) m | EAppOp { op; tys; args } -> eappop ~op:(fop op) ~tys:(List.map typ tys) ~args:(List.map f args) m | EArray args -> earray (List.map f args) m