Fix rendering of type equalities

Please see the comment in the diff.
This commit is contained in:
mrkkrp 2019-06-28 23:37:16 +02:00 committed by Mark Karpov
parent 057977d60c
commit 8c27549532
3 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,2 @@
foo :: (a ~ b) => a -> b -> Int
foo = undefined

View File

@ -0,0 +1,2 @@
foo :: (a ~ b) => a -> b -> Int
foo = undefined

View File

@ -17,7 +17,6 @@ where
import Control.Monad
import Data.List (isPrefixOf)
import GHC hiding (GhcPs, IE)
import Module (Module (..))
import Name (nameStableString)
import OccName (OccName (..))
import Ormolu.Printer.Combinators
@ -65,8 +64,15 @@ p_rdrName l@(L spn _) = located l $ \x -> do
(atom occName, False)
Qual mname occName ->
(p_qualName mname occName, False)
Orig (Module _ mname) occName ->
(p_qualName mname occName, False)
Orig _ occName ->
-- NOTE This is used when GHC generates code that will be fed
-- into the renamer (e.g. from deriving clauses), but where we
-- want to say that something comes from given module which is
-- not specified in the source code, e.g. @Prelude.map@.
--
-- My current understanding is that the provided module name
-- serves no purpose for us and can be safely ignored.
(atom occName, False)
Exact name ->
-- NOTE I'm not sure this "stable string" is stable enough, but
-- it looks like this is the most robust way to tell if we're