ghc-tcplugin-api icon indicating copy to clipboard operation
ghc-tcplugin-api copied to clipboard

Add a compatibility helper for `TcPluginSolveResult`

Open sheaf opened this issue 7 months ago • 0 comments

Something like this:

mkTcPluginSolveResult :: [Ct] -> [(EvTerm, Ct)] -> [Ct] -> TcPluginSolveResult
#if MIN_VERSION_ghc(9,3,0)
mkTcPluginSolveResult = TcPluginSolveResult
#else
mkTcPluginSolveResult contras solved new =
  -- On GHC 9.2 and below, it's not possible to return
  -- both contradictions and solved/new constraints.
  if null contras
  then TcPluginOk solved new
  else TcPluginContradiction contras
#endif

sheaf avatar Sep 09 '25 18:09 sheaf