diff options
author | sheaf <sam.derbyshire@gmail.com> | 2023-05-15 15:23:49 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-15 18:03:00 -0400 |
commit | 4d29ecdfcc79ad663e066d9f7d6d17b64c8c6c41 (patch) | |
tree | 985890c63aee54a2e94e31aa85cbec44652987b9 /testsuite/tests/rename/should_fail/rnfail055.stderr | |
parent | d69cbd78999071d2d6479be40ae90ddd83b9942a (diff) | |
download | haskell-4d29ecdfcc79ad663e066d9f7d6d17b64c8c6c41.tar.gz |
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).
Diffstat (limited to 'testsuite/tests/rename/should_fail/rnfail055.stderr')
-rw-r--r-- | testsuite/tests/rename/should_fail/rnfail055.stderr | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/testsuite/tests/rename/should_fail/rnfail055.stderr b/testsuite/tests/rename/should_fail/rnfail055.stderr index 787009a4c6..1077a6eb10 100644 --- a/testsuite/tests/rename/should_fail/rnfail055.stderr +++ b/testsuite/tests/rename/should_fail/rnfail055.stderr @@ -5,116 +5,117 @@ RnFail055.hs:2:73: warning: [-Wdeprecated-flags (in -Wdefault)] RnFail055.hs-boot:2:73: warning: [-Wdeprecated-flags (in -Wdefault)] -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. -RnFail055.hs-boot:5:1: error: +RnFail055.hs-boot:5:1: error: [GHC-11890] Identifier ‘f1’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: f1 :: Int -> Float - Boot file: f1 :: Float -> Int - The two types are different + Boot file: f1 :: Float -> Int + The two types are different. -RnFail055.hs-boot:7:1: error: +RnFail055.hs-boot:7:1: error: [GHC-15843] Type constructor ‘S1’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type S1 :: * -> * -> * type S1 a b = (a, b) - Boot file: type S1 :: * -> * -> * -> * + Boot file: type S1 :: * -> * -> * -> * type S1 a b c = (a, b) - The types have different kinds + The types have different kinds. -RnFail055.hs-boot:9:1: error: +RnFail055.hs-boot:9:1: error: [GHC-15843] Type constructor ‘S2’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type S2 :: * -> * -> * type S2 a b = forall a1. (a1, b) - Boot file: type S2 :: * -> * -> * + Boot file: type S2 :: * -> * -> * type S2 a b = forall b1. (a, b1) The roles do not match. - Roles on abstract types default to ‘representational’ in boot files. + NB: roles on abstract types default to ‘representational’ in hs-boot files. -RnFail055.hs-boot:13:1: error: +RnFail055.hs-boot:13:1: error: [GHC-15843] Type constructor ‘T1’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type T1 :: * -> * -> * data T1 a b = T1 [b] [a] - Boot file: type T1 :: * -> * -> * + Boot file: type T1 :: * -> * -> * data T1 a b = T1 [a] [b] - The constructors do not match: The types for ‘T1’ differ + The constructors do not match: The types for ‘T1’ differ. -RnFail055.hs-boot:15:1: error: +RnFail055.hs-boot:15:1: error: [GHC-15843] Type constructor ‘T2’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type role T2 representational nominal type T2 :: * -> * -> * data Eq b => T2 a b = T2 a - Boot file: type role T2 nominal phantom + Boot file: type role T2 nominal phantom type T2 :: * -> * -> * data Eq a => T2 a b = T2 a The roles do not match. - Roles on abstract types default to ‘representational’ in boot files. - The datatype contexts do not match - The constructors do not match: The types for ‘T2’ differ + NB: roles on abstract types default to ‘representational’ in hs-boot files. + The datatype contexts do not match. + The constructors do not match: The types for ‘T2’ differ. -RnFail055.hs-boot:17:11: error: - ‘T3’ is exported by the hs-boot file, but not exported by the module +RnFail055.hs-boot:17:11: error: [GHC-91999] + ‘T3’ is exported by the hs-boot file, but not exported by the implementing module. -RnFail055.hs-boot:18:12: error: - ‘T3'’ is exported by the hs-boot file, but not exported by the module +RnFail055.hs-boot:18:12: error: [GHC-91999] + ‘T3'’ is exported by the hs-boot file, but not exported by the implementing module. -RnFail055.hs-boot:22:1: error: +RnFail055.hs-boot:22:1: error: [GHC-15843] Type constructor ‘T5’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type T5 :: * -> * data T5 a = T5 {field5 :: a} - Boot file: type T5 :: * -> * + Boot file: type T5 :: * -> * data T5 a = T5 a The constructors do not match: - The record label lists for ‘T5’ differ + The record label lists for ‘T5’ differ. -RnFail055.hs-boot:24:1: error: +RnFail055.hs-boot:24:1: error: [GHC-15843] Type constructor ‘T6’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type T6 :: * data T6 = T6 Int - Boot file: type T6 :: * + Boot file: type T6 :: * data T6 = T6 !Int The constructors do not match: - The strictness annotations for ‘T6’ differ + The strictness annotations for ‘T6’ differ. -RnFail055.hs-boot:26:1: error: +RnFail055.hs-boot:26:1: error: [GHC-15843] Type constructor ‘T7’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type role T7 phantom type T7 :: * -> * data T7 a = forall a1. T7 a1 - Boot file: type T7 :: * -> * + Boot file: type T7 :: * -> * data T7 a = forall b. T7 a The roles do not match. - Roles on abstract types default to ‘representational’ in boot files. - The constructors do not match: The types for ‘T7’ differ + NB: roles on abstract types default to ‘representational’ in hs-boot files. + The constructors do not match: The types for ‘T7’ differ. -RnFail055.hs-boot:28:22: error: - ‘RnFail055.m1’ is exported by the hs-boot file, but not exported by the module +RnFail055.hs-boot:28:22: error: [GHC-91999] + ‘RnFail055.m1’ is exported by the hs-boot file, but not exported by the implementing module. -RnFail055.hs-boot:29:1: error: +RnFail055.hs-boot:29:1: error: [GHC-15843] Class ‘C2’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type C2 :: * -> * -> Constraint class C2 a b where m2 :: a -> b m2' :: a -> b {-# MINIMAL m2, m2' #-} - Boot file: type C2 :: * -> * -> Constraint + Boot file: type C2 :: * -> * -> Constraint class C2 a b where m2 :: a -> b {-# MINIMAL m2 #-} - The methods do not match: There are different numbers of methods - The MINIMAL pragmas are not compatible + The class methods do not match: + The number of class methods differs. + The MINIMAL pragmas are not compatible. -RnFail055.hs-boot:30:1: error: +RnFail055.hs-boot:30:1: error: [GHC-15843] Class ‘C3’ has conflicting definitions in the module - and its hs-boot file + and its hs-boot file. Main module: type C3 :: * -> Constraint class (Eq a, Ord a) => C3 a - Boot file: type C3 :: * -> Constraint + Boot file: type C3 :: * -> Constraint class (Ord a, Eq a) => C3 a - The class constraints do not match + The superclass constraints do not match. |