diff --git a/src/passes/2-simplify/cameligo.ml b/src/passes/2-simplify/cameligo.ml index b2bef414c..7dbb027d7 100644 --- a/src/passes/2-simplify/cameligo.ml +++ b/src/passes/2-simplify/cameligo.ml @@ -327,9 +327,9 @@ let rec simpl_expression : let%bind type_expr' = simpl_type_expression type_expr in return @@ e_annotation ~loc expr' type_expr' | EVar c -> - let c' = c.value in + let (c',loc) = r_split c in (match constants c' with - | Error _ -> return @@ e_variable (Var.of_name c.value) + | Error _ -> return @@ e_variable ~loc (Var.of_name c.value) | Ok (s,_) -> return @@ e_constant s []) | ECall x -> ( let ((e1 , e2) , loc) = r_split x in diff --git a/src/passes/4-typer-new/typer.ml b/src/passes/4-typer-new/typer.ml index f22dd61f9..e6848c232 100644 --- a/src/passes/4-typer-new/typer.ml +++ b/src/passes/4-typer-new/typer.ml @@ -23,10 +23,11 @@ module Errors = struct error ~data title message () let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () = - let title = (thunk "unbound variable") in + let name () = Format.asprintf "%a" Stage_common.PP.name n in + let title = (thunk ("unbound variable "^(name ()))) in let message () = "" in let data = [ - ("variable" , fun () -> Format.asprintf "%a" Stage_common.PP.name n) ; + ("variable" , name) ; ("environment" , fun () -> Format.asprintf "%a" Environment.PP.full_environment e) ; ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ] in diff --git a/src/passes/4-typer-old/typer.ml b/src/passes/4-typer-old/typer.ml index b54b7e579..20b54514b 100644 --- a/src/passes/4-typer-old/typer.ml +++ b/src/passes/4-typer-old/typer.ml @@ -30,10 +30,11 @@ module Errors = struct error ~data title message () let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () = - let title = (thunk "unbound variable") in + let name () = Format.asprintf "%a" Stage_common.PP.name n in + let title = (thunk ("unbound variable "^(name ()))) in let message () = "" in let data = [ - ("variable" , fun () -> Format.asprintf "%a" Stage_common.PP.name n) ; + ("variable" , name) ; ("environment" , fun () -> Format.asprintf "%a" Environment.PP.full_environment e) ; ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ] in