Note [Don't add HasCallStack constraints to the solved set]

GHC/Tc/Solver/Monad.hs:569 compiler 1 ticket

We must not add solved Wanted dictionaries that mention HasCallStack constraints
to the solved set, or we might fail to accumulate the proper call stack, as was
reported in #25529.

Recall that HasCallStack constraints (and the related HasExceptionContext
constraints) are implicit parameter constraints, and are accumulated as per
Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence.

When we solve a Wanted that contains a HasCallStack constraint, we don't want
to cache the result, because re-using that solution means re-using the call-stack
in a different context!

See also Note [Shadowing of implicit parameters], which deals with a similar
problem with Given implicit parameter constraints.

References 2

Referenced by 2