on master help sign in
Fix GHC panic on showOutputable
e7c080eUtku Demir
src/Ormolu/Utils.hs+2−1
@@ -22,6 +22,7 @@ import Data.Maybe (fromMaybe)
22import Data.Text (Text)
22import Data.Text (Text)
23import qualified Data.Text as T
23import qualified Data.Text as T
24import GHC
24import GHC
25+import GHC.DynFlags (baseDynFlags)
25import qualified Outputable as GHC
26import qualified Outputable as GHC
26
27
27-- | Combine all source spans from the given list.
28-- | Combine all source spans from the given list.
@@ -38,7 +39,7 @@ notImplemented msg = error $ "not implemented yet: " ++ msg
38
39
39-- | Pretty-print an 'GHC.Outputable' thing.
40-- | Pretty-print an 'GHC.Outputable' thing.
40showOutputable :: GHC.Outputable o => o -> String
41showOutputable :: GHC.Outputable o => o -> String
41−showOutputable = GHC.showSDocUnsafe . GHC.ppr
42+showOutputable = GHC.showSDoc baseDynFlags . GHC.ppr
42
43
43-- | Split and normalize a doc string. The result is a list of lines that
44-- | Split and normalize a doc string. The result is a list of lines that
44-- make up the comment.
45-- make up the comment.