From 0e9899eb8c6779ea706e76e5d6224a8332c3ce59 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 4 Aug 2025 10:35:05 +0200 Subject: Updated an error message in a better way --- lib/checks/get_type.ml | 3 +-- lib/checks/type_of.ml | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/checks') diff --git a/lib/checks/get_type.ml b/lib/checks/get_type.ml index 00270c2..c6d1e44 100644 --- a/lib/checks/get_type.ml +++ b/lib/checks/get_type.ml @@ -12,8 +12,7 @@ type type_of = | Integer (** A numeric value *) | Bool (** A boolean, not a real type *) | String (** String value *) - | NumericString - [@printer fun fmt _ -> Format.pp_print_string fmt "Integer as String"] + | NumericString [@printer fun fmt _ -> Format.pp_print_string fmt "String"] (** String containing a numeric value *) [@@deriving show { with_path = false }, eq] diff --git a/lib/checks/type_of.ml b/lib/checks/type_of.ml index 243c8b3..4593842 100644 --- a/lib/checks/type_of.ml +++ b/lib/checks/type_of.ml @@ -95,8 +95,9 @@ module Helper = struct else let result_type = match actual.t with Variable v -> v | Raw r -> r in let message = - Format.asprintf "The type %a is expected but got %a" Get_type.pp_type_of - expected Get_type.pp_type_of result_type + Format.asprintf + "The expression has type %a but the context was expecting a %a" + Get_type.pp_type_of result_type Get_type.pp_type_of expected in Report.message level actual.pos message :: report -- cgit v1.2.3