Module Analyzer.Diagnostic

Diagnostics reported by analyze and get_unreachable.

A diagnostic only records the data that explains it; its textual rendering is left to the client, Diagnostic.pp being a default printer.

type kind =
  1. | Unchecked of {
    1. check : Ast.check;
    2. expected : Mlsem_types.GTy.t;
    3. given : Mlsem_types.GTy.t;
    }
    (*

    A coercion whose expression type given is not a subtype of the type expected, and that is not checked at runtime: check is either CheckStatic (only the static part is checked) or NoCheck.

    *)
  2. | Unreachable
    (*

    The expression is not reached by any annotation.

    *)
type t = {
  1. eid : Mlsem_common.Eid.t;
    (*

    The expression concerned by the diagnostic

    *)
  2. kind : kind;
}
val severity : t -> severity

Default printers

val title : t -> string

A short, one-line summary of the diagnostic.

val pp_descr : Stdlib.Format.formatter -> t -> unit

Prints the details of the diagnostic, or nothing if there are none.

val descr : t -> string option

The output of pp_descr, or None if it is empty.

val pp : Stdlib.Format.formatter -> t -> unit

Prints the title followed by the descr, if any.