diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-01-04 15:35:47 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-22 15:00:47 -0500 |
commit | a64f21e9f6bd949847d3c8fa1e427e5c763ccd7f (patch) | |
tree | cdf6eb8daa58254190a0c8dacdc681b13c3ba884 /testsuite/tests/ghc-api | |
parent | 34950fb84b85d964e30ae9eca995b84fbf4fd165 (diff) | |
download | haskell-a64f21e9f6bd949847d3c8fa1e427e5c763ccd7f.tar.gz |
Parameterise Messages over e
This commit paves the way to a richer and more structured representation
of GHC error messages, as per GHC proposal #306. More specifically
'Messages' from 'GHC.Types.Error' now gains an extra type parameter,
that we instantiate to 'ErrDoc' for now. Later, this will allow us to
replace ErrDoc with something more structure (for example messages
coming from the parser, the typechecker etc).
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r-- | testsuite/tests/ghc-api/T18522-dbg-ppr.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/testsuite/tests/ghc-api/T18522-dbg-ppr.hs b/testsuite/tests/ghc-api/T18522-dbg-ppr.hs index 39da5f1292..a29dc194dd 100644 --- a/testsuite/tests/ghc-api/T18522-dbg-ppr.hs +++ b/testsuite/tests/ghc-api/T18522-dbg-ppr.hs @@ -4,6 +4,7 @@ module Main where import Language.Haskell.TH (runQ) import GHC.Types.Basic +import GHC.Types.Error import GHC.ThToHs import GHC.Driver.Session import GHC.Core.TyCo.Ppr @@ -42,8 +43,9 @@ main = do () |] let hs_t = fromRight (error "convertToHsType") $ convertToHsType Generated noSrcSpan th_t - ((warnings, errors), mres) <- + (messages, mres) <- tcRnType hsc_env SkolemiseFlexi True hs_t + let (warnings, errors) = partitionMessages messages case mres of Nothing -> do printBagOfErrors dflags warnings |