aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChimrod <>2025-08-04 10:35:05 +0200
committerChimrod <>2025-08-04 14:00:40 +0200
commit0e9899eb8c6779ea706e76e5d6224a8332c3ce59 (patch)
treeb95430805f13610d2f02d82f5a6732e57c8d49b0 /lib
parentc3982131f3075689a15512daef67e254f27371ea (diff)
Updated an error message in a better way
Diffstat (limited to 'lib')
-rw-r--r--lib/checks/get_type.ml3
-rw-r--r--lib/checks/type_of.ml5
2 files changed, 4 insertions, 4 deletions
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