From 4d29ecdfcc79ad663e066d9f7d6d17b64c8c6c41 Mon Sep 17 00:00:00 2001 From: sheaf Date: Mon, 15 May 2023 15:23:49 +0200 Subject: Migrate errors to diagnostics in GHC.Tc.Module This commit migrates the errors in GHC.Tc.Module to use the new diagnostic infrastructure. It required a significant overhaul of the compatibility checks between an hs-boot or signature module and its implementation; we now use a Writer monad to accumulate errors; see the BootMismatch datatype in GHC.Tc.Errors.Types, with its panoply of subtypes. For the sake of readability, several local functions inside the 'checkBootTyCon' function were split off into top-level functions. We split off GHC.Types.HscSource into a "boot or sig" vs "normal hs file" datatype, as this mirrors the logic in several other places where we want to treat hs-boot and hsig files in a similar fashion. This commit also refactors the Backpack checks for type synonyms implementing abstract data, to correctly reject implementations that contain qualified or quantified types (this fixes #23342 and #23344). --- testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr') diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr index e6a1f31a82..4d56d26651 100644 --- a/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr +++ b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr @@ -1,10 +1,10 @@ -q/H.hsig:2:1: error: +q\H.hsig:2:1: error: [GHC-11890] • Identifier ‘x’ has conflicting definitions in the module - and its hsig file + and its hsig file. Main module: x :: Int - Hsig file: x :: Bool - The two types are different + Hsig file: x :: Bool + The two types are different. • while merging the signatures from: • bkpcabal01-0.1.0.0:p[H=]:H • ...and the local signature for H -- cgit v1.2.1