s/expression_eq/equal_variables/ to match the behavior

This commit is contained in:
Tom Jack 2020-04-22 11:44:57 -05:00
parent 2a8edb53da
commit b47b5b1c37
3 changed files with 4 additions and 3 deletions

View File

@ -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')

View File

@ -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

View File

@ -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