diff --git a/src/passes/10-transpiler/transpiler.ml b/src/passes/10-transpiler/transpiler.ml index b66880e93..37c005ef6 100644 --- a/src/passes/10-transpiler/transpiler.ml +++ b/src/passes/10-transpiler/transpiler.ml @@ -489,7 +489,7 @@ and transpile_annotated_expression (ae:AST.expression) : expression result = | AST.E_record_update {record=record'; path=path'; update=update'} -> ( match record'.expression_content with | AST.E_record_accessor {record;path} -> - if (AST.Misc.expression_eq record r && path = p) then + if (AST.Misc.equal_variables record r && path = p) then aux res' (record',path',update') else ok @@ (up,res') | _ -> ok @@ (up,res') diff --git a/src/stages/4-ast_typed/misc.ml b/src/stages/4-ast_typed/misc.ml index 338178043..95c1b9289 100644 --- a/src/stages/4-ast_typed/misc.ml +++ b/src/stages/4-ast_typed/misc.ml @@ -528,7 +528,7 @@ let program_environment (program : program) : full_environment = match last_declaration with | Declaration_constant { binder=_ ; expr=_ ; inline=_ ; post_env } -> post_env -let expression_eq a b : bool = +let equal_variables a b : bool = match a.expression_content, b.expression_content with | E_variable a, E_variable b -> Var.equal a b | _, _ -> false diff --git a/src/stages/4-ast_typed/misc.mli b/src/stages/4-ast_typed/misc.mli index ed4813f1c..924702ce8 100644 --- a/src/stages/4-ast_typed/misc.mli +++ b/src/stages/4-ast_typed/misc.mli @@ -9,7 +9,8 @@ val merge_annotation : type_expression option -> type_expression option -> error (* No information about what made it fail *) val type_expression_eq : ( type_expression * type_expression ) -> bool -val expression_eq : expression -> expression -> bool + +val equal_variables : expression -> expression -> bool module Free_variables : sig type bindings = expression_variable list