module Message = struct type t = | SyntaxError | IllTyped | UnboundVariable | CannotInferType | Bug let default_severity : t -> Asai.Diagnostic.severity = function | SyntaxError -> Error | IllTyped -> Error | UnboundVariable -> Error | CannotInferType -> Error | Bug -> Bug let short_code : t -> string = function | SyntaxError -> "E001" | IllTyped -> "E002" | UnboundVariable -> "E003" | CannotInferType -> "E004" | Bug -> "BUG" end include Asai.Reporter.Make(Message) let unbound_variable id = fatalf UnboundVariable "unbound variable %a" Ident.pp id let expected_universe fmt x = fatalf IllTyped "expected a universe but got %a" fmt x let bug msg = fatalf Bug msg