ghc-9.4.0.20220721: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Tc.Errors

Synopsis

Documentation

reportUnsolved :: WantedConstraints -> TcM (Bag EvBind) Source #

Report unsolved goals as errors or warnings. We may also turn some into deferred run-time errors if `-fdefer-type-errors` is on.

reportAllUnsolved :: WantedConstraints -> TcM () Source #

Report *all* unsolved goals as errors, even if -fdefer-type-errors is on However, do not make any evidence bindings, because we don't have any convenient place to put them. NB: Type-level holes are OK, because there are no bindings. See Note [Deferring coercion errors to runtime] Used by solveEqualities for kind equalities (see Note [Fail fast on kind errors] in GHC.Tc.Solver)

warnAllUnsolved :: WantedConstraints -> TcM () Source #

Report all unsolved goals as warnings (but without deferring any errors to run-time). See Note [Safe Haskell Overlapping Instances Implementation] in GHC.Tc.Solver

GHC API helper functions

solverReportMsg_ExpectedActuals :: TcSolverReportMsg -> [(Type, Type)] Source #

If the TcSolverReportMsg is a type mismatch between an actual and an expected type, return the actual and expected types (in that order).

Prefer using this over manually inspecting the TcSolverReportMsg datatype if you just want this information, as the datatype itself is subject to change across GHC versions.

solverReportInfo_ExpectedActuals :: TcSolverReportInfo -> [(Type, Type)] Source #

Retrieves all "expected"/"actual" messages from a TcSolverReportInfo.

Prefer using this over inspecting the TcSolverReportInfo datatype if you just need this information, as the datatype itself is subject to change across GHC versions.