Documentation

Lean.ErrorExplanation

Metadata for an error explanation.

  • summary gives a short description of the error
  • sinceVersion indicates the version of Lean in which an error with this error name was introduced
  • severity is the severity of the diagnostic
  • removedVersion indicates the version of Lean in which this error name was retired, if applicable
Instances For

    An explanation of a named error message.

    Error explanations are rendered in the manual; a link to the resulting manual page is displayed at the bottom of corresponding error messages thrown using throwNamedError or throwNamedErrorAt.

    Instances For

      Returns the error explanation summary prepended with its severity. For use in completions and hovers.

      Equations
        Instances For

          An environment extension that stores error explanations.

          Returns an error explanation for the given name if one exists.

          Equations
            Instances For
              @[deprecated Lean.getErrorExplanation? (since := "2026-12-20")]
              Equations
                Instances For
                  def Lean.hasErrorExplanation {m : TypeType} [Monad m] [MonadEnv m] (name : Name) :

                  Returns true if there exists an error explanation named name.

                  Equations
                    Instances For

                      Returns all error explanations with their names, sorted by name.

                      Equations
                        Instances For
                          @[deprecated Lean.getErrorExplanations (since := "2026-12-20")]
                          Equations
                            Instances For
                              @[deprecated Lean.getErrorExplanations (since := "2026-12-20")]
                              Equations
                                Instances For