|
@@ -13,7 +13,7 @@ type call_error =
|
|
|
|
|
|
and error_msg =
|
|
|
| Module_not_found of path
|
|
|
- | Type_not_found of path * string
|
|
|
+ | Type_not_found of path * string * type_not_found_reason
|
|
|
| Unify of unify_error list
|
|
|
| Custom of string
|
|
|
| Unknown_ident of string
|
|
@@ -21,6 +21,10 @@ and error_msg =
|
|
|
| Call_error of call_error
|
|
|
| No_constructor of module_type
|
|
|
|
|
|
+and type_not_found_reason =
|
|
|
+ | Private_type
|
|
|
+ | Not_defined
|
|
|
+
|
|
|
exception Fatal_error of string * Globals.pos
|
|
|
exception Error of error_msg * Globals.pos
|
|
|
|
|
@@ -260,7 +264,8 @@ end
|
|
|
|
|
|
let rec error_msg = function
|
|
|
| Module_not_found m -> "Type not found : " ^ s_type_path m
|
|
|
- | Type_not_found (m,t) -> "Module " ^ s_type_path m ^ " does not define type " ^ t
|
|
|
+ | Type_not_found (m,t,Private_type) -> "Cannot access private type " ^ t ^ " in module " ^ s_type_path m
|
|
|
+ | Type_not_found (m,t,Not_defined) -> "Module " ^ s_type_path m ^ " does not define type " ^ t
|
|
|
| Unify l -> BetterErrors.better_error_message l
|
|
|
| Unknown_ident s -> "Unknown identifier : " ^ s
|
|
|
| Custom s -> s
|