summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-06-11 23:49:27 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-06-13 10:57:03 +0100
commit15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72 (patch)
treee2e7336c63e9b7130ba70f3551ff290d4a25184b /testsuite/tests
parentd25cb61a1c2a135a2564143a332f8b2962f134bc (diff)
downloadhaskell-15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72.tar.gz
Improve typechecking of let-bindings
This major commit was initially triggered by #11339, but it spiraled into a major review of the way in which type signatures for bindings are handled, especially partial type signatures. On the way I fixed a number of other bugs, namely #12069 #12033 #11700 #11339 #11670 The main change is that I completely reorganised the way in which type signatures in bindings are handled. The new story is in TcSigs Note [Overview of type signatures]. Some specific: * Changes in the data types for signatures in TcRnTypes: TcIdSigInfo and new TcIdSigInst * New module TcSigs deals with typechecking type signatures and pragmas. It contains code mostly moved from TcBinds, which is already too big * HsTypes: I swapped the nesting of HsWildCardBndrs and HsImplicitBndsrs, so that the wildcards are on the oustide not the insidde in a LHsSigWcType. This is just a matter of convenient, nothing deep. There are a host of other changes as knock-on effects, and it all took FAR longer than I anticipated :-). But it is a significant improvement, I think. Lots of error messages changed slightly, some just variants but some modest improvements. New tests * typecheck/should_compile * SigTyVars: a scoped-tyvar test * ExPat, ExPatFail: existential pattern bindings * T12069 * T11700 * T11339 * partial-sigs/should_compile * T12033 * T11339a * T11670 One thing to check: * Small change to output from ghc-api/landmines. Need to check with Alan Zimmerman
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/arrows/should_fail/T5380.stderr64
-rw-r--r--testsuite/tests/dependent/should_compile/T11241.stderr10
-rw-r--r--testsuite/tests/deriving/should_fail/T7148.stderr36
-rw-r--r--testsuite/tests/deriving/should_fail/T7148a.stderr22
-rw-r--r--testsuite/tests/gadt/T3169.stderr38
-rw-r--r--testsuite/tests/gadt/T7558.stderr30
-rw-r--r--testsuite/tests/gadt/gadt-escape1.stderr38
-rw-r--r--testsuite/tests/gadt/gadt13.stderr34
-rw-r--r--testsuite/tests/gadt/gadt7.stderr40
-rw-r--r--testsuite/tests/gadt/rw.stderr60
-rw-r--r--testsuite/tests/ghc-api/landmines/landmines.stdout8
-rw-r--r--testsuite/tests/ghci/scripts/Defer02.stderr395
-rw-r--r--testsuite/tests/ghci/scripts/T10248.stderr28
-rw-r--r--testsuite/tests/ghci/scripts/ghci050.stderr28
-rw-r--r--testsuite/tests/indexed-types/should_compile/Simple14.stderr35
-rw-r--r--testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr34
-rw-r--r--testsuite/tests/indexed-types/should_fail/Overlap6.stderr28
-rw-r--r--testsuite/tests/indexed-types/should_fail/SimpleFail5a.stderr26
-rw-r--r--testsuite/tests/indexed-types/should_fail/T2664.stderr38
-rw-r--r--testsuite/tests/indexed-types/should_fail/T3330a.hs7
-rw-r--r--testsuite/tests/indexed-types/should_fail/T3330a.stderr74
-rw-r--r--testsuite/tests/indexed-types/should_fail/T3440.stderr48
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4093a.stderr32
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4093b.stderr84
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4174.stderr32
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4272.stderr34
-rw-r--r--testsuite/tests/indexed-types/should_fail/T7786.stderr86
-rw-r--r--testsuite/tests/indexed-types/should_fail/T9662.stderr70
-rw-r--r--testsuite/tests/module/mod71.stderr24
-rw-r--r--testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_compile/Either.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr36
-rw-r--r--testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr179
-rw-r--r--testsuite/tests/partial-sigs/should_compile/SuperCls.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.stderr158
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10438.stderr54
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10519.stderr12
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11016.stderr19
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11192.stderr82
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11339a.hs6
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11339a.stderr6
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11670.hs16
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T11670.stderr36
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T12033.hs13
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T12033.stderr24
-rw-r--r--testsuite/tests/partial-sigs/should_compile/Uncurry.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr110
-rw-r--r--testsuite/tests/partial-sigs/should_compile/all.T5
-rw-r--r--testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr11
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs2
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr36
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr34
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr93
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr26
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr48
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr24
-rw-r--r--testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr26
-rw-r--r--testsuite/tests/partial-sigs/should_fail/PatBind3.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10045.stderr48
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10615.stderr68
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10999.stderr50
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T11122.stderr11
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T11976.stderr14
-rw-r--r--testsuite/tests/partial-sigs/should_fail/TidyClash.stderr18
-rw-r--r--testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr46
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr106
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr148
-rw-r--r--testsuite/tests/partial-sigs/should_fail/all.T3
-rw-r--r--testsuite/tests/patsyn/should_fail/T11010.stderr28
-rw-r--r--testsuite/tests/patsyn/should_fail/T11039.stderr18
-rw-r--r--testsuite/tests/patsyn/should_fail/T11667.stderr82
-rw-r--r--testsuite/tests/polykinds/T10503.stderr32
-rw-r--r--testsuite/tests/polykinds/T11399.hs5
-rw-r--r--testsuite/tests/polykinds/T11399.stderr18
-rw-r--r--testsuite/tests/polykinds/T7438.stderr40
-rw-r--r--testsuite/tests/polykinds/T7594.stderr34
-rw-r--r--testsuite/tests/polykinds/T9017.stderr26
-rw-r--r--testsuite/tests/rename/should_fail/rnfail026.stderr21
-rw-r--r--testsuite/tests/th/T10267.stderr92
-rw-r--r--testsuite/tests/typecheck/should_compile/ExPat.hs17
-rw-r--r--testsuite/tests/typecheck/should_compile/ExPatFail.hs13
-rw-r--r--testsuite/tests/typecheck/should_compile/ExPatFail.stderr14
-rw-r--r--testsuite/tests/typecheck/should_compile/FD1.stderr20
-rw-r--r--testsuite/tests/typecheck/should_compile/FD2.stderr40
-rw-r--r--testsuite/tests/typecheck/should_compile/FD3.stderr30
-rw-r--r--testsuite/tests/typecheck/should_compile/SigTyVars.hs12
-rw-r--r--testsuite/tests/typecheck/should_compile/T10072.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/T10632.stderr10
-rw-r--r--testsuite/tests/typecheck/should_compile/T11339.hs32
-rw-r--r--testsuite/tests/typecheck/should_compile/T11339.stderr15
-rw-r--r--testsuite/tests/typecheck/should_compile/T11339b.hs32
-rw-r--r--testsuite/tests/typecheck/should_compile/T11339c.hs32
-rw-r--r--testsuite/tests/typecheck/should_compile/T11339d.hs15
-rw-r--r--testsuite/tests/typecheck/should_compile/T11700.hs18
-rw-r--r--testsuite/tests/typecheck/should_compile/T12069.hs4
-rw-r--r--testsuite/tests/typecheck/should_compile/T2357.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/T2494.stderr72
-rw-r--r--testsuite/tests/typecheck/should_compile/T9834.stderr92
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr40
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T9
-rw-r--r--testsuite/tests/typecheck/should_compile/holes.stderr66
-rw-r--r--testsuite/tests/typecheck/should_compile/holes3.stderr72
-rw-r--r--testsuite/tests/typecheck/should_compile/tc141.stderr108
-rw-r--r--testsuite/tests/typecheck/should_fail/T10285.stderr44
-rw-r--r--testsuite/tests/typecheck/should_fail/T10534.stderr38
-rw-r--r--testsuite/tests/typecheck/should_fail/T10715.stderr27
-rw-r--r--testsuite/tests/typecheck/should_fail/T11347.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/T2714.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T3102.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/T5691.stderr38
-rw-r--r--testsuite/tests/typecheck/should_fail/T7264.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T7748a.stderr40
-rw-r--r--testsuite/tests/typecheck/should_fail/T7869.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/T8450.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T9109.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/mc19.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/mc21.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/mc22.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail065.stderr34
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail068.stderr284
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail076.stderr38
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail103.stderr48
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail131.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail153.stderr34
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.stderr60
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail175.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail179.stderr44
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail191.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail193.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail198.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr38
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail206.stderr110
141 files changed, 2969 insertions, 2680 deletions
diff --git a/testsuite/tests/arrows/should_fail/T5380.stderr b/testsuite/tests/arrows/should_fail/T5380.stderr
index 0e258a2c28..6c7caf789d 100644
--- a/testsuite/tests/arrows/should_fail/T5380.stderr
+++ b/testsuite/tests/arrows/should_fail/T5380.stderr
@@ -1,32 +1,32 @@
-
-T5380.hs:7:27: error:
- • Couldn't match expected type ‘Bool’ with actual type ‘not_bool’
- ‘not_bool’ is a rigid type variable bound by
- the type signature for:
- testB :: forall not_bool not_unit.
- not_bool -> (() -> ()) -> () -> not_unit
- at T5380.hs:6:10
- • In the expression: b
- In the expression: proc () -> if b then f -< () else f -< ()
- In an equation for ‘testB’:
- testB b f = proc () -> if b then f -< () else f -< ()
- • Relevant bindings include
- b :: not_bool (bound at T5380.hs:7:7)
- testB :: not_bool -> (() -> ()) -> () -> not_unit
- (bound at T5380.hs:7:1)
-
-T5380.hs:7:34: error:
- • Couldn't match type ‘not_unit’ with ‘()’
- ‘not_unit’ is a rigid type variable bound by
- the type signature for:
- testB :: forall not_bool not_unit.
- not_bool -> (() -> ()) -> () -> not_unit
- at T5380.hs:6:10
- Expected type: () -> not_unit
- Actual type: () -> ()
- • In the expression: f
- In the command: f -< ()
- In the expression: proc () -> if b then f -< () else f -< ()
- • Relevant bindings include
- testB :: not_bool -> (() -> ()) -> () -> not_unit
- (bound at T5380.hs:7:1)
+
+T5380.hs:7:27: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘not_bool’
+ ‘not_bool’ is a rigid type variable bound by
+ the type signature for:
+ testB :: forall not_bool not_unit.
+ not_bool -> (() -> ()) -> () -> not_unit
+ at T5380.hs:6:1-49
+ • In the expression: b
+ In the expression: proc () -> if b then f -< () else f -< ()
+ In an equation for ‘testB’:
+ testB b f = proc () -> if b then f -< () else f -< ()
+ • Relevant bindings include
+ b :: not_bool (bound at T5380.hs:7:7)
+ testB :: not_bool -> (() -> ()) -> () -> not_unit
+ (bound at T5380.hs:7:1)
+
+T5380.hs:7:34: error:
+ • Couldn't match type ‘not_unit’ with ‘()’
+ ‘not_unit’ is a rigid type variable bound by
+ the type signature for:
+ testB :: forall not_bool not_unit.
+ not_bool -> (() -> ()) -> () -> not_unit
+ at T5380.hs:6:1-49
+ Expected type: () -> not_unit
+ Actual type: () -> ()
+ • In the expression: f
+ In the command: f -< ()
+ In the expression: proc () -> if b then f -< () else f -< ()
+ • Relevant bindings include
+ testB :: not_bool -> (() -> ()) -> () -> not_unit
+ (bound at T5380.hs:7:1)
diff --git a/testsuite/tests/dependent/should_compile/T11241.stderr b/testsuite/tests/dependent/should_compile/T11241.stderr
index f6ec57e03d..fe80b47c3c 100644
--- a/testsuite/tests/dependent/should_compile/T11241.stderr
+++ b/testsuite/tests/dependent/should_compile/T11241.stderr
@@ -1,6 +1,4 @@
-
-T11241.hs:5:21: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘*’
- • In the type signature:
- foo :: forall (a :: _). a -> a
- • Relevant bindings include foo :: a -> a (bound at T11241.hs:6:1)
+
+T11241.hs:5:21: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘*’
+ • In the type signature: foo :: forall (a :: _). a -> a
diff --git a/testsuite/tests/deriving/should_fail/T7148.stderr b/testsuite/tests/deriving/should_fail/T7148.stderr
index afdd1f9d99..a9314f9d64 100644
--- a/testsuite/tests/deriving/should_fail/T7148.stderr
+++ b/testsuite/tests/deriving/should_fail/T7148.stderr
@@ -1,18 +1,18 @@
-
-T7148.hs:27:40: error:
- • Couldn't match type ‘b’ with ‘Tagged a b’
- arising from the coercion of the method ‘iso2’
- from type ‘forall b. SameType b () -> SameType b b’
- to type ‘forall b. SameType b () -> SameType b (Tagged a b)’
- ‘b’ is a rigid type variable bound by
- the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40
- • When deriving the instance for (IsoUnit (Tagged a b))
-
-T7148.hs:27:40: error:
- • Couldn't match type ‘b’ with ‘Tagged a b’
- arising from the coercion of the method ‘iso1’
- from type ‘forall b. SameType () b -> SameType b b’
- to type ‘forall b. SameType () b -> SameType (Tagged a b) b’
- ‘b’ is a rigid type variable bound by
- the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40
- • When deriving the instance for (IsoUnit (Tagged a b))
+
+T7148.hs:27:40: error:
+ • Couldn't match type ‘b’ with ‘Tagged a b’
+ arising from the coercion of the method ‘iso2’
+ from type ‘forall b. SameType b () -> SameType b b’
+ to type ‘forall b. SameType b () -> SameType b (Tagged a b)’
+ ‘b’ is a rigid type variable bound by
+ the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40-46
+ • When deriving the instance for (IsoUnit (Tagged a b))
+
+T7148.hs:27:40: error:
+ • Couldn't match type ‘b’ with ‘Tagged a b’
+ arising from the coercion of the method ‘iso1’
+ from type ‘forall b. SameType () b -> SameType b b’
+ to type ‘forall b. SameType () b -> SameType (Tagged a b) b’
+ ‘b’ is a rigid type variable bound by
+ the deriving clause for ‘IsoUnit (Tagged a b)’ at T7148.hs:27:40-46
+ • When deriving the instance for (IsoUnit (Tagged a b))
diff --git a/testsuite/tests/deriving/should_fail/T7148a.stderr b/testsuite/tests/deriving/should_fail/T7148a.stderr
index 9a6ea41d96..cd1e4db351 100644
--- a/testsuite/tests/deriving/should_fail/T7148a.stderr
+++ b/testsuite/tests/deriving/should_fail/T7148a.stderr
@@ -1,11 +1,11 @@
-
-T7148a.hs:19:50: error:
- • Couldn't match representation of type ‘b’
- with that of ‘Result a b’
- arising from the coercion of the method ‘coerce’
- from type ‘forall b. Proxy b -> a -> Result a b’
- to type ‘forall b.
- Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’
- ‘b’ is a rigid type variable bound by
- the type Proxy b -> a -> Result a b at T7148a.hs:19:50
- • When deriving the instance for (Convert (IS_NO_LONGER a))
+
+T7148a.hs:19:50: error:
+ • Couldn't match representation of type ‘b’
+ with that of ‘Result a b’
+ arising from the coercion of the method ‘coerce’
+ from type ‘forall b. Proxy b -> a -> Result a b’
+ to type ‘forall b.
+ Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’
+ ‘b’ is a rigid type variable bound by
+ the type Proxy b -> a -> Result a b at T7148a.hs:19:50-56
+ • When deriving the instance for (Convert (IS_NO_LONGER a))
diff --git a/testsuite/tests/gadt/T3169.stderr b/testsuite/tests/gadt/T3169.stderr
index 4c9097eacd..433333f21d 100644
--- a/testsuite/tests/gadt/T3169.stderr
+++ b/testsuite/tests/gadt/T3169.stderr
@@ -1,19 +1,19 @@
-
-T3169.hs:13:22: error:
- • Couldn't match type ‘elt’ with ‘Map b elt’
- ‘elt’ is a rigid type variable bound by
- the type signature for:
- lookup :: forall elt. (a, b) -> Map (a, b) elt -> Maybe elt
- at T3169.hs:12:3
- Expected type: Map a (Map b elt)
- Actual type: Map (a, b) elt
- • In the second argument of ‘lookup’, namely ‘m’
- In the expression: lookup a m :: Maybe (Map b elt)
- In the expression:
- case lookup a m :: Maybe (Map b elt) of {
- Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt }
- • Relevant bindings include
- m :: Map (a, b) elt (bound at T3169.hs:12:17)
- b :: b (bound at T3169.hs:12:13)
- lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
- (bound at T3169.hs:12:3)
+
+T3169.hs:13:22: error:
+ • Couldn't match type ‘elt’ with ‘Map b elt’
+ ‘elt’ is a rigid type variable bound by
+ the type signature for:
+ lookup :: forall elt. (a, b) -> Map (a, b) elt -> Maybe elt
+ at T3169.hs:12:3-8
+ Expected type: Map a (Map b elt)
+ Actual type: Map (a, b) elt
+ • In the second argument of ‘lookup’, namely ‘m’
+ In the expression: lookup a m :: Maybe (Map b elt)
+ In the expression:
+ case lookup a m :: Maybe (Map b elt) of {
+ Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt }
+ • Relevant bindings include
+ m :: Map (a, b) elt (bound at T3169.hs:12:17)
+ b :: b (bound at T3169.hs:12:13)
+ lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
+ (bound at T3169.hs:12:3)
diff --git a/testsuite/tests/gadt/T7558.stderr b/testsuite/tests/gadt/T7558.stderr
index 6618346452..34ade9778e 100644
--- a/testsuite/tests/gadt/T7558.stderr
+++ b/testsuite/tests/gadt/T7558.stderr
@@ -1,15 +1,15 @@
-
-T7558.hs:8:4: error:
- • Couldn't match type ‘a’ with ‘Maybe a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a. T a a -> Bool
- at T7558.hs:7:6
- Inaccessible code in
- a pattern with constructor:
- MkT :: forall a b. a ~ Maybe b => a -> Maybe b -> T a b,
- in an equation for ‘f’
- • In the pattern: MkT x y
- In an equation for ‘f’: f (MkT x y) = [x, y] `seq` True
- • Relevant bindings include
- f :: T a a -> Bool (bound at T7558.hs:8:1)
+
+T7558.hs:8:4: error:
+ • Couldn't match type ‘a’ with ‘Maybe a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. T a a -> Bool
+ at T7558.hs:7:1-18
+ Inaccessible code in
+ a pattern with constructor:
+ MkT :: forall a b. a ~ Maybe b => a -> Maybe b -> T a b,
+ in an equation for ‘f’
+ • In the pattern: MkT x y
+ In an equation for ‘f’: f (MkT x y) = [x, y] `seq` True
+ • Relevant bindings include
+ f :: T a a -> Bool (bound at T7558.hs:8:1)
diff --git a/testsuite/tests/gadt/gadt-escape1.stderr b/testsuite/tests/gadt/gadt-escape1.stderr
index 9bcd99cffe..ccd428f106 100644
--- a/testsuite/tests/gadt/gadt-escape1.stderr
+++ b/testsuite/tests/gadt/gadt-escape1.stderr
@@ -1,19 +1,19 @@
-
-gadt-escape1.hs:19:58: error:
- • Couldn't match type ‘t’ with ‘ExpGADT Int’
- ‘t’ is untouchable
- inside the constraints: t1 ~ Int
- bound by a pattern with constructor: ExpInt :: Int -> ExpGADT Int,
- in a case alternative
- at gadt-escape1.hs:19:43-50
- ‘t’ is a rigid type variable bound by
- the inferred type of weird1 :: t at gadt-escape1.hs:19:1
- Possible fix: add a type signature for ‘weird1’
- Expected type: t
- Actual type: ExpGADT t1
- • In the expression: a
- In a case alternative: Hidden (ExpInt _) a -> a
- In the expression:
- case (hval :: Hidden) of { Hidden (ExpInt _) a -> a }
- • Relevant bindings include
- weird1 :: t (bound at gadt-escape1.hs:19:1)
+
+gadt-escape1.hs:19:58: error:
+ • Couldn't match type ‘t’ with ‘ExpGADT Int’
+ ‘t’ is untouchable
+ inside the constraints: t1 ~ Int
+ bound by a pattern with constructor: ExpInt :: Int -> ExpGADT Int,
+ in a case alternative
+ at gadt-escape1.hs:19:43-50
+ ‘t’ is a rigid type variable bound by
+ the inferred type of weird1 :: t at gadt-escape1.hs:19:1-58
+ Possible fix: add a type signature for ‘weird1’
+ Expected type: t
+ Actual type: ExpGADT t1
+ • In the expression: a
+ In a case alternative: Hidden (ExpInt _) a -> a
+ In the expression:
+ case (hval :: Hidden) of { Hidden (ExpInt _) a -> a }
+ • Relevant bindings include
+ weird1 :: t (bound at gadt-escape1.hs:19:1)
diff --git a/testsuite/tests/gadt/gadt13.stderr b/testsuite/tests/gadt/gadt13.stderr
index 797fd0ba4d..06b1f9c720 100644
--- a/testsuite/tests/gadt/gadt13.stderr
+++ b/testsuite/tests/gadt/gadt13.stderr
@@ -1,17 +1,17 @@
-
-gadt13.hs:15:13: error:
- • Couldn't match expected type ‘t’
- with actual type ‘String -> [Char]’
- ‘t’ is untouchable
- inside the constraints: t1 ~ Int
- bound by a pattern with constructor: I :: Int -> Term Int,
- in an equation for ‘shw’
- at gadt13.hs:15:6-8
- ‘t’ is a rigid type variable bound by
- the inferred type of shw :: Term t1 -> t at gadt13.hs:15:1
- Possible fix: add a type signature for ‘shw’
- • Possible cause: ‘(.)’ is applied to too many arguments
- In the expression: ("I " ++) . shows t
- In an equation for ‘shw’: shw (I t) = ("I " ++) . shows t
- • Relevant bindings include
- shw :: Term t1 -> t (bound at gadt13.hs:15:1)
+
+gadt13.hs:15:13: error:
+ • Couldn't match expected type ‘t’
+ with actual type ‘String -> [Char]’
+ ‘t’ is untouchable
+ inside the constraints: t1 ~ Int
+ bound by a pattern with constructor: I :: Int -> Term Int,
+ in an equation for ‘shw’
+ at gadt13.hs:15:6-8
+ ‘t’ is a rigid type variable bound by
+ the inferred type of shw :: Term t1 -> t at gadt13.hs:15:1-30
+ Possible fix: add a type signature for ‘shw’
+ • Possible cause: ‘(.)’ is applied to too many arguments
+ In the expression: ("I " ++) . shows t
+ In an equation for ‘shw’: shw (I t) = ("I " ++) . shows t
+ • Relevant bindings include
+ shw :: Term t1 -> t (bound at gadt13.hs:15:1)
diff --git a/testsuite/tests/gadt/gadt7.stderr b/testsuite/tests/gadt/gadt7.stderr
index 35c8e10363..6e1effa067 100644
--- a/testsuite/tests/gadt/gadt7.stderr
+++ b/testsuite/tests/gadt/gadt7.stderr
@@ -1,20 +1,20 @@
-
-gadt7.hs:16:38: error:
- • Couldn't match expected type ‘t’ with actual type ‘t1’
- ‘t’ is untouchable
- inside the constraints: t2 ~ Int
- bound by a pattern with constructor: K :: T Int,
- in a case alternative
- at gadt7.hs:16:33
- ‘t’ is a rigid type variable bound by
- the inferred type of i1b :: T t2 -> t1 -> t at gadt7.hs:16:1
- ‘t1’ is a rigid type variable bound by
- the inferred type of i1b :: T t2 -> t1 -> t at gadt7.hs:16:1
- Possible fix: add a type signature for ‘i1b’
- • In the expression: y1
- In a case alternative: K -> y1
- In the expression: case t1 of { K -> y1 }
- • Relevant bindings include
- y1 :: t1 (bound at gadt7.hs:16:16)
- y :: t1 (bound at gadt7.hs:16:7)
- i1b :: T t2 -> t1 -> t (bound at gadt7.hs:16:1)
+
+gadt7.hs:16:38: error:
+ • Couldn't match expected type ‘t’ with actual type ‘t1’
+ ‘t’ is untouchable
+ inside the constraints: t2 ~ Int
+ bound by a pattern with constructor: K :: T Int,
+ in a case alternative
+ at gadt7.hs:16:33
+ ‘t’ is a rigid type variable bound by
+ the inferred type of i1b :: T t2 -> t1 -> t at gadt7.hs:16:1-44
+ ‘t1’ is a rigid type variable bound by
+ the inferred type of i1b :: T t2 -> t1 -> t at gadt7.hs:16:1-44
+ Possible fix: add a type signature for ‘i1b’
+ • In the expression: y1
+ In a case alternative: K -> y1
+ In the expression: case t1 of { K -> y1 }
+ • Relevant bindings include
+ y1 :: t1 (bound at gadt7.hs:16:16)
+ y :: t1 (bound at gadt7.hs:16:7)
+ i1b :: T t2 -> t1 -> t (bound at gadt7.hs:16:1)
diff --git a/testsuite/tests/gadt/rw.stderr b/testsuite/tests/gadt/rw.stderr
index c79bb72b4c..4c53ff2aa1 100644
--- a/testsuite/tests/gadt/rw.stderr
+++ b/testsuite/tests/gadt/rw.stderr
@@ -1,30 +1,30 @@
-
-rw.hs:14:47: error:
- • Couldn't match expected type ‘a’ with actual type ‘Int’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- writeInt :: forall a. T a -> IORef a -> IO ()
- at rw.hs:12:12
- • In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’
- In the expression: writeIORef ref (1 :: Int)
- In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
- • Relevant bindings include
- ref :: IORef a (bound at rw.hs:13:12)
- v :: T a (bound at rw.hs:13:10)
- writeInt :: T a -> IORef a -> IO () (bound at rw.hs:13:1)
-
-rw.hs:19:43: error:
- • Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- readBool :: forall a. T a -> IORef a -> IO ()
- at rw.hs:16:12
- Expected type: a -> IO ()
- Actual type: Bool -> IO ()
- • In the second argument of ‘(>>=)’, namely ‘(print . not)’
- In the expression: readIORef ref >>= (print . not)
- In a case alternative: ~(Lb x) -> readIORef ref >>= (print . not)
- • Relevant bindings include
- ref :: IORef a (bound at rw.hs:17:12)
- v :: T a (bound at rw.hs:17:10)
- readBool :: T a -> IORef a -> IO () (bound at rw.hs:17:1)
+
+rw.hs:14:47: error:
+ • Couldn't match expected type ‘a’ with actual type ‘Int’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ writeInt :: forall a. T a -> IORef a -> IO ()
+ at rw.hs:12:1-34
+ • In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’
+ In the expression: writeIORef ref (1 :: Int)
+ In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
+ • Relevant bindings include
+ ref :: IORef a (bound at rw.hs:13:12)
+ v :: T a (bound at rw.hs:13:10)
+ writeInt :: T a -> IORef a -> IO () (bound at rw.hs:13:1)
+
+rw.hs:19:43: error:
+ • Couldn't match type ‘a’ with ‘Bool’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ readBool :: forall a. T a -> IORef a -> IO ()
+ at rw.hs:16:1-34
+ Expected type: a -> IO ()
+ Actual type: Bool -> IO ()
+ • In the second argument of ‘(>>=)’, namely ‘(print . not)’
+ In the expression: readIORef ref >>= (print . not)
+ In a case alternative: ~(Lb x) -> readIORef ref >>= (print . not)
+ • Relevant bindings include
+ ref :: IORef a (bound at rw.hs:17:12)
+ v :: T a (bound at rw.hs:17:10)
+ readBool :: T a -> IORef a -> IO () (bound at rw.hs:17:1)
diff --git a/testsuite/tests/ghc-api/landmines/landmines.stdout b/testsuite/tests/ghc-api/landmines/landmines.stdout
index 279b92c715..39d6acc353 100644
--- a/testsuite/tests/ghc-api/landmines/landmines.stdout
+++ b/testsuite/tests/ghc-api/landmines/landmines.stdout
@@ -1,4 +1,4 @@
-(12,12,8)
-(93,63,0)
-(15,13,7)
-(10,10,8)
+(12,12,8)
+(93,63,0)
+(15,13,8)
+(10,10,8)
diff --git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr
index 7318eb632a..bcc6c5eff5 100644
--- a/testsuite/tests/ghci/scripts/Defer02.stderr
+++ b/testsuite/tests/ghci/scripts/Defer02.stderr
@@ -1,198 +1,197 @@
-
-../../typecheck/should_run/Defer01.hs:11:40: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘Char’ with ‘[Char]’
- Expected type: String
- Actual type: Char
- • In the first argument of ‘putStr’, namely ‘','’
- In the second argument of ‘(>>)’, namely ‘putStr ','’
- In the expression: putStr "Hello World" >> putStr ','
-
-../../typecheck/should_run/Defer01.hs:14:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match expected type ‘Int’ with actual type ‘Char’
- • In the expression: 'p'
- In an equation for ‘a’: a = 'p'
-
-../../typecheck/should_run/Defer01.hs:18:7: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • No instance for (Eq B) arising from a use of ‘==’
- • In the expression: x == x
- In an equation for ‘b’: b x = x == x
-
-../../typecheck/should_run/Defer01.hs:25:1: warning: [-Woverlapping-patterns (in -Wdefault)]
- Pattern match has inaccessible right hand side
- In an equation for ‘c’: c (C2 x) = ...
-
-../../typecheck/should_run/Defer01.hs:25:4: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘Int’ with ‘Bool’
- Inaccessible code in
- a pattern with constructor: C2 :: Bool -> C Bool,
- in an equation for ‘c’
- • In the pattern: C2 x
- In an equation for ‘c’: c (C2 x) = True
-
-../../typecheck/should_run/Defer01.hs:28:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • No instance for (Num (a -> a)) arising from the literal ‘1’
- (maybe you haven't applied a function to enough arguments?)
- • In the expression: 1
- In an equation for ‘d’: d = 1
-
-../../typecheck/should_run/Defer01.hs:31:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
- • The function ‘e’ is applied to one argument,
- but its type ‘Char’ has none
- In the expression: e 'q'
- In an equation for ‘f’: f = e 'q'
- • Relevant bindings include
- f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
-
-../../typecheck/should_run/Defer01.hs:34:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match expected type ‘Char’ with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- h :: forall a. a -> (Char, Char)
- at ../../typecheck/should_run/Defer01.hs:33:6
- • In the expression: x
- In the expression: (x, 'c')
- In an equation for ‘h’: h x = (x, 'c')
- • Relevant bindings include
- x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
- h :: a -> (Char, Char)
- (bound at ../../typecheck/should_run/Defer01.hs:34:1)
-
-../../typecheck/should_run/Defer01.hs:39:17: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match expected type ‘Bool’ with actual type ‘T a’
- • In the first argument of ‘not’, namely ‘(K a)’
- In the expression: (not (K a))
- In the expression: seq (not (K a)) ()
- • Relevant bindings include
- a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
- i :: a -> () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
-
-../../typecheck/should_run/Defer01.hs:43:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • No instance for (MyClass a1) arising from a use of ‘myOp’
- • In the expression: myOp 23
- In an equation for ‘j’: j = myOp 23
-
-../../typecheck/should_run/Defer01.hs:43:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Ambiguous type variable ‘a1’ arising from the literal ‘23’
- prevents the constraint ‘(Num a1)’ from being solved.
- Probable fix: use a type annotation to specify what ‘a1’ should be.
- These potential instances exist:
- instance Num Integer -- Defined in ‘GHC.Num’
- instance Num Double -- Defined in ‘GHC.Float’
- instance Num Float -- Defined in ‘GHC.Float’
- ...plus two others
- (use -fprint-potential-instances to see them all)
- • In the first argument of ‘myOp’, namely ‘23’
- In the expression: myOp 23
- In an equation for ‘j’: j = myOp 23
-
-../../typecheck/should_run/Defer01.hs:45:1: warning: [-Wdeferred-type-errors (in -Wdefault)]
- Couldn't match type ‘Int’ with ‘Bool’
- Inaccessible code in
- the type signature for:
- k :: Int ~ Bool => Int -> Bool
-
-../../typecheck/should_run/Defer01.hs:45:6: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘Int’ with ‘Bool’
- Inaccessible code in
- the type signature for:
- k :: Int ~ Bool => Int -> Bool
- • In the ambiguity check for ‘k’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- k :: (Int ~ Bool) => Int -> Bool
-
-../../typecheck/should_run/Defer01.hs:46:1: warning: [-Woverlapping-patterns (in -Wdefault)]
- Pattern match is redundant
- In an equation for ‘k’: k x = ...
-
-../../typecheck/should_run/Defer01.hs:49:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match expected type ‘IO a0’
- with actual type ‘Char -> IO ()’
- • Probable cause: ‘putChar’ is applied to too few arguments
- In the first argument of ‘(>>)’, namely ‘putChar’
- In the expression: putChar >> putChar 'p'
- In an equation for ‘l’: l = putChar >> putChar 'p'
-*** Exception: ../../typecheck/should_run/Defer01.hs:11:40: error:
- • Couldn't match type ‘Char’ with ‘[Char]’
- Expected type: String
- Actual type: Char
- • In the first argument of ‘putStr’, namely ‘','’
- In the second argument of ‘(>>)’, namely ‘putStr ','’
- In the expression: putStr "Hello World" >> putStr ','
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:14:5: error:
- • Couldn't match expected type ‘Int’ with actual type ‘Char’
- • In the expression: 'p'
- In an equation for ‘a’: a = 'p'
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:18:7: error:
- • No instance for (Eq B) arising from a use of ‘==’
- • In the expression: x == x
- In an equation for ‘b’: b x = x == x
-(deferred type error)
-
-<interactive>:7:11: error:
- • Couldn't match type ‘Bool’ with ‘Int’
- Expected type: C Int
- Actual type: C Bool
- • In the first argument of ‘c’, namely ‘(C2 True)’
- In the first argument of ‘print’, namely ‘(c (C2 True))’
- In the expression: print (c (C2 True))
-*** Exception: ../../typecheck/should_run/Defer01.hs:28:5: error:
- • No instance for (Num (a -> a)) arising from the literal ‘1’
- (maybe you haven't applied a function to enough arguments?)
- • In the expression: 1
- In an equation for ‘d’: d = 1
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:31:5: error:
- • Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
- • The function ‘e’ is applied to one argument,
- but its type ‘Char’ has none
- In the expression: e 'q'
- In an equation for ‘f’: f = e 'q'
- • Relevant bindings include
- f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:34:8: error:
- • Couldn't match expected type ‘Char’ with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- h :: forall a. a -> (Char, Char)
- at ../../typecheck/should_run/Defer01.hs:33:6
- • In the expression: x
- In the expression: (x, 'c')
- In an equation for ‘h’: h x = (x, 'c')
- • Relevant bindings include
- x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
- h :: a -> (Char, Char)
- (bound at ../../typecheck/should_run/Defer01.hs:34:1)
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:39:17: error:
- • Couldn't match expected type ‘Bool’ with actual type ‘T a’
- • In the first argument of ‘not’, namely ‘(K a)’
- In the expression: (not (K a))
- In the expression: seq (not (K a)) ()
- • Relevant bindings include
- a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
- i :: a -> () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
-(deferred type error)
-*** Exception: ../../typecheck/should_run/Defer01.hs:43:5: error:
- • No instance for (MyClass a1) arising from a use of ‘myOp’
- • In the expression: myOp 23
- In an equation for ‘j’: j = myOp 23
-(deferred type error)
-
-<interactive>:13:8: error:
- • Couldn't match type ‘Int’ with ‘Bool’ arising from a use of ‘k’
- • In the first argument of ‘print’, namely ‘(k 2)’
- In the expression: print (k 2)
- In an equation for ‘it’: it = print (k 2)
-*** Exception: ../../typecheck/should_run/Defer01.hs:49:5: error:
- • Couldn't match expected type ‘IO a0’
- with actual type ‘Char -> IO ()’
- • Probable cause: ‘putChar’ is applied to too few arguments
- In the first argument of ‘(>>)’, namely ‘putChar’
- In the expression: putChar >> putChar 'p'
- In an equation for ‘l’: l = putChar >> putChar 'p'
-(deferred type error)
+
+..\..\typecheck\should_run\Defer01.hs:11:40: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘Char’ with ‘[Char]’
+ Expected type: String
+ Actual type: Char
+ • In the first argument of ‘putStr’, namely ‘','’
+ In the second argument of ‘(>>)’, namely ‘putStr ','’
+ In the expression: putStr "Hello World" >> putStr ','
+
+..\..\typecheck\should_run\Defer01.hs:14:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match expected type ‘Int’ with actual type ‘Char’
+ • In the expression: 'p'
+ In an equation for ‘a’: a = 'p'
+
+..\..\typecheck\should_run\Defer01.hs:18:7: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • No instance for (Eq B) arising from a use of ‘==’
+ • In the expression: x == x
+ In an equation for ‘b’: b x = x == x
+
+..\..\typecheck\should_run\Defer01.hs:25:1: warning: [-Woverlapping-patterns (in -Wdefault)]
+ Pattern match has inaccessible right hand side
+ In an equation for ‘c’: c (C2 x) = ...
+
+..\..\typecheck\should_run\Defer01.hs:25:4: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘Int’ with ‘Bool’
+ Inaccessible code in
+ a pattern with constructor: C2 :: Bool -> C Bool,
+ in an equation for ‘c’
+ • In the pattern: C2 x
+ In an equation for ‘c’: c (C2 x) = True
+
+..\..\typecheck\should_run\Defer01.hs:28:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • No instance for (Num (a -> a)) arising from the literal ‘1’
+ (maybe you haven't applied a function to enough arguments?)
+ • In the expression: 1
+ In an equation for ‘d’: d = 1
+
+..\..\typecheck\should_run\Defer01.hs:31:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
+ • The function ‘e’ is applied to one argument,
+ but its type ‘Char’ has none
+ In the expression: e 'q'
+ In an equation for ‘f’: f = e 'q'
+ • Relevant bindings include
+ f :: t (bound at ..\..\typecheck\should_run\Defer01.hs:31:1)
+
+..\..\typecheck\should_run\Defer01.hs:34:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match expected type ‘Char’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ h :: forall a. a -> (Char, Char)
+ at ..\..\typecheck\should_run\Defer01.hs:33:1-21
+ • In the expression: x
+ In the expression: (x, 'c')
+ In an equation for ‘h’: h x = (x, 'c')
+ • Relevant bindings include
+ x :: a (bound at ..\..\typecheck\should_run\Defer01.hs:34:3)
+ h :: a -> (Char, Char)
+ (bound at ..\..\typecheck\should_run\Defer01.hs:34:1)
+
+..\..\typecheck\should_run\Defer01.hs:39:17: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match expected type ‘Bool’ with actual type ‘T a’
+ • In the first argument of ‘not’, namely ‘(K a)’
+ In the expression: (not (K a))
+ In the expression: seq (not (K a)) ()
+ • Relevant bindings include
+ a :: a (bound at ..\..\typecheck\should_run\Defer01.hs:39:3)
+ i :: a -> () (bound at ..\..\typecheck\should_run\Defer01.hs:39:1)
+
+..\..\typecheck\should_run\Defer01.hs:43:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • No instance for (MyClass a1) arising from a use of ‘myOp’
+ • In the expression: myOp 23
+ In an equation for ‘j’: j = myOp 23
+
+..\..\typecheck\should_run\Defer01.hs:43:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Ambiguous type variable ‘a1’ arising from the literal ‘23’
+ prevents the constraint ‘(Num a1)’ from being solved.
+ Probable fix: use a type annotation to specify what ‘a1’ should be.
+ These potential instances exist:
+ instance Num Integer -- Defined in ‘GHC.Num’
+ instance Num Double -- Defined in ‘GHC.Float’
+ instance Num Float -- Defined in ‘GHC.Float’
+ ...plus two others
+ (use -fprint-potential-instances to see them all)
+ • In the first argument of ‘myOp’, namely ‘23’
+ In the expression: myOp 23
+ In an equation for ‘j’: j = myOp 23
+
+..\..\typecheck\should_run\Defer01.hs:45:1: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ Couldn't match type ‘Int’ with ‘Bool’
+ Inaccessible code in
+ the type signature for:
+ k :: Int ~ Bool => Int -> Bool
+
+..\..\typecheck\should_run\Defer01.hs:45:6: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘Int’ with ‘Bool’
+ Inaccessible code in
+ the type signature for:
+ k :: Int ~ Bool => Int -> Bool
+ • In the ambiguity check for ‘k’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: k :: (Int ~ Bool) => Int -> Bool
+
+..\..\typecheck\should_run\Defer01.hs:46:1: warning: [-Woverlapping-patterns (in -Wdefault)]
+ Pattern match is redundant
+ In an equation for ‘k’: k x = ...
+
+..\..\typecheck\should_run\Defer01.hs:49:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match expected type ‘IO a0’
+ with actual type ‘Char -> IO ()’
+ • Probable cause: ‘putChar’ is applied to too few arguments
+ In the first argument of ‘(>>)’, namely ‘putChar’
+ In the expression: putChar >> putChar 'p'
+ In an equation for ‘l’: l = putChar >> putChar 'p'
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:11:40: error:
+ • Couldn't match type ‘Char’ with ‘[Char]’
+ Expected type: String
+ Actual type: Char
+ • In the first argument of ‘putStr’, namely ‘','’
+ In the second argument of ‘(>>)’, namely ‘putStr ','’
+ In the expression: putStr "Hello World" >> putStr ','
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:14:5: error:
+ • Couldn't match expected type ‘Int’ with actual type ‘Char’
+ • In the expression: 'p'
+ In an equation for ‘a’: a = 'p'
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:18:7: error:
+ • No instance for (Eq B) arising from a use of ‘==’
+ • In the expression: x == x
+ In an equation for ‘b’: b x = x == x
+(deferred type error)
+
+<interactive>:7:11: error:
+ • Couldn't match type ‘Bool’ with ‘Int’
+ Expected type: C Int
+ Actual type: C Bool
+ • In the first argument of ‘c’, namely ‘(C2 True)’
+ In the first argument of ‘print’, namely ‘(c (C2 True))’
+ In the expression: print (c (C2 True))
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:28:5: error:
+ • No instance for (Num (a -> a)) arising from the literal ‘1’
+ (maybe you haven't applied a function to enough arguments?)
+ • In the expression: 1
+ In an equation for ‘d’: d = 1
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:31:5: error:
+ • Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
+ • The function ‘e’ is applied to one argument,
+ but its type ‘Char’ has none
+ In the expression: e 'q'
+ In an equation for ‘f’: f = e 'q'
+ • Relevant bindings include
+ f :: t (bound at ..\..\typecheck\should_run\Defer01.hs:31:1)
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:34:8: error:
+ • Couldn't match expected type ‘Char’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ h :: forall a. a -> (Char, Char)
+ at ..\..\typecheck\should_run\Defer01.hs:33:1-21
+ • In the expression: x
+ In the expression: (x, 'c')
+ In an equation for ‘h’: h x = (x, 'c')
+ • Relevant bindings include
+ x :: a (bound at ..\..\typecheck\should_run\Defer01.hs:34:3)
+ h :: a -> (Char, Char)
+ (bound at ..\..\typecheck\should_run\Defer01.hs:34:1)
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:39:17: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘T a’
+ • In the first argument of ‘not’, namely ‘(K a)’
+ In the expression: (not (K a))
+ In the expression: seq (not (K a)) ()
+ • Relevant bindings include
+ a :: a (bound at ..\..\typecheck\should_run\Defer01.hs:39:3)
+ i :: a -> () (bound at ..\..\typecheck\should_run\Defer01.hs:39:1)
+(deferred type error)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:43:5: error:
+ • No instance for (MyClass a1) arising from a use of ‘myOp’
+ • In the expression: myOp 23
+ In an equation for ‘j’: j = myOp 23
+(deferred type error)
+
+<interactive>:13:8: error:
+ • Couldn't match type ‘Int’ with ‘Bool’ arising from a use of ‘k’
+ • In the first argument of ‘print’, namely ‘(k 2)’
+ In the expression: print (k 2)
+ In an equation for ‘it’: it = print (k 2)
+*** Exception: ..\..\typecheck\should_run\Defer01.hs:49:5: error:
+ • Couldn't match expected type ‘IO a0’
+ with actual type ‘Char -> IO ()’
+ • Probable cause: ‘putChar’ is applied to too few arguments
+ In the first argument of ‘(>>)’, namely ‘putChar’
+ In the expression: putChar >> putChar 'p'
+ In an equation for ‘l’: l = putChar >> putChar 'p'
+(deferred type error)
diff --git a/testsuite/tests/ghci/scripts/T10248.stderr b/testsuite/tests/ghci/scripts/T10248.stderr
index c9df22b056..7172d4aa50 100644
--- a/testsuite/tests/ghci/scripts/T10248.stderr
+++ b/testsuite/tests/ghci/scripts/T10248.stderr
@@ -1,14 +1,14 @@
-
-<interactive>:2:10: error:
- • Found hole: _ :: f a
- Where: ‘f’ is a rigid type variable bound by
- the inferred type of it :: Functor f => f (Maybe a)
- at <interactive>:2:1
- ‘a’ is a rigid type variable bound by
- the inferred type of it :: Functor f => f (Maybe a)
- at <interactive>:2:1
- • In the second argument of ‘(<$>)’, namely ‘_’
- In the expression: Just <$> _
- In an equation for ‘it’: it = Just <$> _
- • Relevant bindings include
- it :: f (Maybe a) (bound at <interactive>:2:1)
+
+<interactive>:2:10: error:
+ • Found hole: _ :: f a
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of it :: Functor f => f (Maybe a)
+ at <interactive>:2:1-10
+ ‘a’ is a rigid type variable bound by
+ the inferred type of it :: Functor f => f (Maybe a)
+ at <interactive>:2:1-10
+ • In the second argument of ‘(<$>)’, namely ‘_’
+ In the expression: Just <$> _
+ In an equation for ‘it’: it = Just <$> _
+ • Relevant bindings include
+ it :: f (Maybe a) (bound at <interactive>:2:1)
diff --git a/testsuite/tests/ghci/scripts/ghci050.stderr b/testsuite/tests/ghci/scripts/ghci050.stderr
index 588d130172..0ea252e23d 100644
--- a/testsuite/tests/ghci/scripts/ghci050.stderr
+++ b/testsuite/tests/ghci/scripts/ghci050.stderr
@@ -1,14 +1,14 @@
-
-<interactive>:5:49: error:
- • Couldn't match expected type ‘ListableElem (a, a)’
- with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the instance declaration at <interactive>:5:10
- • In the expression: a
- In the expression: [a, b]
- In an equation for ‘asList’: asList (a, b) = [a, b]
- • Relevant bindings include
- b :: a (bound at <interactive>:5:43)
- a :: a (bound at <interactive>:5:41)
- asList :: (a, a) -> [ListableElem (a, a)]
- (bound at <interactive>:5:33)
+
+<interactive>:5:49: error:
+ • Couldn't match expected type ‘ListableElem (a, a)’
+ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the instance declaration at <interactive>:5:10-23
+ • In the expression: a
+ In the expression: [a, b]
+ In an equation for ‘asList’: asList (a, b) = [a, b]
+ • Relevant bindings include
+ b :: a (bound at <interactive>:5:43)
+ a :: a (bound at <interactive>:5:41)
+ asList :: (a, a) -> [ListableElem (a, a)]
+ (bound at <interactive>:5:33)
diff --git a/testsuite/tests/indexed-types/should_compile/Simple14.stderr b/testsuite/tests/indexed-types/should_compile/Simple14.stderr
index bbbe0fbc58..eadcfc6953 100644
--- a/testsuite/tests/indexed-types/should_compile/Simple14.stderr
+++ b/testsuite/tests/indexed-types/should_compile/Simple14.stderr
@@ -1,18 +1,17 @@
-
-Simple14.hs:8:8: error:
- • Couldn't match type ‘z0’ with ‘z’
- ‘z0’ is untouchable
- inside the constraints: x ~ y
- bound by the type signature for:
- eqE :: x ~ y => EQ_ z0 z0
- at Simple14.hs:8:8-39
- ‘z’ is a rigid type variable bound by
- the type signature for:
- eqE :: forall x y z p. EQ_ x y -> (x ~ y => EQ_ z z) -> p
- at Simple14.hs:8:8
- Expected type: EQ_ z0 z0
- Actual type: EQ_ z z
- • In the ambiguity check for ‘eqE’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- eqE :: EQ_ x y -> (x ~ y => EQ_ z z) -> p
+
+Simple14.hs:8:8: error:
+ • Couldn't match type ‘z0’ with ‘z’
+ ‘z0’ is untouchable
+ inside the constraints: x ~ y
+ bound by the type signature for:
+ eqE :: x ~ y => EQ_ z0 z0
+ at Simple14.hs:8:8-39
+ ‘z’ is a rigid type variable bound by
+ the type signature for:
+ eqE :: forall x y z p. EQ_ x y -> (x ~ y => EQ_ z z) -> p
+ at Simple14.hs:8:8-39
+ Expected type: EQ_ z0 z0
+ Actual type: EQ_ z z
+ • In the ambiguity check for ‘eqE’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: eqE :: EQ_ x y -> (x ~ y => EQ_ z z) -> p
diff --git a/testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr b/testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr
index 5a0892ed31..f8689f9b8d 100644
--- a/testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr
+++ b/testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr
@@ -1,17 +1,17 @@
-
-GADTwrong1.hs:12:21: error:
- • Couldn't match expected type ‘b’ with actual type ‘c’
- ‘c’ is a rigid type variable bound by
- a pattern with constructor: T :: forall c. c -> T (Const c),
- in a case alternative
- at GADTwrong1.hs:12:14
- ‘b’ is a rigid type variable bound by
- the type signature for:
- coerce :: forall a b. a -> b
- at GADTwrong1.hs:10:20
- • In the expression: y
- In a case alternative: T y -> y
- In the expression: case T x :: T (Const b) of { T y -> y }
- • Relevant bindings include
- y :: c (bound at GADTwrong1.hs:12:16)
- coerce :: a -> b (bound at GADTwrong1.hs:11:1)
+
+GADTwrong1.hs:12:21: error:
+ • Couldn't match expected type ‘b’ with actual type ‘c’
+ ‘c’ is a rigid type variable bound by
+ a pattern with constructor: T :: forall c. c -> T (Const c),
+ in a case alternative
+ at GADTwrong1.hs:12:14-16
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ coerce :: forall a b. a -> b
+ at GADTwrong1.hs:10:1-29
+ • In the expression: y
+ In a case alternative: T y -> y
+ In the expression: case T x :: T (Const b) of { T y -> y }
+ • Relevant bindings include
+ y :: c (bound at GADTwrong1.hs:12:16)
+ coerce :: a -> b (bound at GADTwrong1.hs:11:1)
diff --git a/testsuite/tests/indexed-types/should_fail/Overlap6.stderr b/testsuite/tests/indexed-types/should_fail/Overlap6.stderr
index 6ffcda02ce..406ac9d3b6 100644
--- a/testsuite/tests/indexed-types/should_fail/Overlap6.stderr
+++ b/testsuite/tests/indexed-types/should_fail/Overlap6.stderr
@@ -1,14 +1,14 @@
-
-Overlap6.hs:15:7: error:
- • Couldn't match type ‘x’ with ‘And x 'True’
- ‘x’ is a rigid type variable bound by
- the type signature for:
- g :: forall (x :: Bool). Proxy x -> Proxy (And x 'True)
- at Overlap6.hs:14:6
- Expected type: Proxy (And x 'True)
- Actual type: Proxy x
- • In the expression: x
- In an equation for ‘g’: g x = x
- • Relevant bindings include
- x :: Proxy x (bound at Overlap6.hs:15:3)
- g :: Proxy x -> Proxy (And x 'True) (bound at Overlap6.hs:15:1)
+
+Overlap6.hs:15:7: error:
+ • Couldn't match type ‘x’ with ‘And x 'True’
+ ‘x’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall (x :: Bool). Proxy x -> Proxy (And x 'True)
+ at Overlap6.hs:14:1-34
+ Expected type: Proxy (And x 'True)
+ Actual type: Proxy x
+ • In the expression: x
+ In an equation for ‘g’: g x = x
+ • Relevant bindings include
+ x :: Proxy x (bound at Overlap6.hs:15:3)
+ g :: Proxy x -> Proxy (And x 'True) (bound at Overlap6.hs:15:1)
diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail5a.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail5a.stderr
index 4b9c3657db..539628c6eb 100644
--- a/testsuite/tests/indexed-types/should_fail/SimpleFail5a.stderr
+++ b/testsuite/tests/indexed-types/should_fail/SimpleFail5a.stderr
@@ -1,13 +1,13 @@
-
-SimpleFail5a.hs:31:11: error:
- • Couldn't match type ‘a’ with ‘Int’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- bar3wrong :: forall a. S3 a -> a
- at SimpleFail5a.hs:30:14
- Expected type: S3 a
- Actual type: S3 Int
- • In the pattern: D3Int
- In an equation for ‘bar3wrong’: bar3wrong D3Int = 1
- • Relevant bindings include
- bar3wrong :: S3 a -> a (bound at SimpleFail5a.hs:31:1)
+
+SimpleFail5a.hs:31:11: error:
+ • Couldn't match type ‘a’ with ‘Int’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ bar3wrong :: forall a. S3 a -> a
+ at SimpleFail5a.hs:30:1-22
+ Expected type: S3 a
+ Actual type: S3 Int
+ • In the pattern: D3Int
+ In an equation for ‘bar3wrong’: bar3wrong D3Int = 1
+ • Relevant bindings include
+ bar3wrong :: S3 a -> a (bound at SimpleFail5a.hs:31:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T2664.stderr b/testsuite/tests/indexed-types/should_fail/T2664.stderr
index 3a84f18272..1409f1f44c 100644
--- a/testsuite/tests/indexed-types/should_fail/T2664.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T2664.stderr
@@ -1,19 +1,19 @@
-
-T2664.hs:31:52: error:
- • Could not deduce: b ~ a arising from a use of ‘newPChan’
- from the context: ((a :*: b) ~ Dual c, c ~ Dual (a :*: b))
- bound by the type signature for:
- newPChan :: ((a :*: b) ~ Dual c, c ~ Dual (a :*: b)) =>
- IO (PChan (a :*: b), PChan c)
- at T2664.hs:23:5-12
- ‘b’ is a rigid type variable bound by
- the instance declaration at T2664.hs:22:10
- ‘a’ is a rigid type variable bound by
- the instance declaration at T2664.hs:22:10
- • In the third argument of ‘pchoose’, namely ‘newPChan’
- In the first argument of ‘E’, namely ‘(pchoose Right v newPChan)’
- In the expression:
- E (pchoose Right v newPChan) (pchoose Left v newPChan)
- • Relevant bindings include
- v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
- newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)
+
+T2664.hs:31:52: error:
+ • Could not deduce: b ~ a arising from a use of ‘newPChan’
+ from the context: ((a :*: b) ~ Dual c, c ~ Dual (a :*: b))
+ bound by the type signature for:
+ newPChan :: ((a :*: b) ~ Dual c, c ~ Dual (a :*: b)) =>
+ IO (PChan (a :*: b), PChan c)
+ at T2664.hs:23:5-12
+ ‘b’ is a rigid type variable bound by
+ the instance declaration at T2664.hs:22:10-52
+ ‘a’ is a rigid type variable bound by
+ the instance declaration at T2664.hs:22:10-52
+ • In the third argument of ‘pchoose’, namely ‘newPChan’
+ In the first argument of ‘E’, namely ‘(pchoose Right v newPChan)’
+ In the expression:
+ E (pchoose Right v newPChan) (pchoose Left v newPChan)
+ • Relevant bindings include
+ v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
+ newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)
diff --git a/testsuite/tests/indexed-types/should_fail/T3330a.hs b/testsuite/tests/indexed-types/should_fail/T3330a.hs
index 55bf067238..b14a7d0858 100644
--- a/testsuite/tests/indexed-types/should_fail/T3330a.hs
+++ b/testsuite/tests/indexed-types/should_fail/T3330a.hs
@@ -30,12 +30,13 @@ children p x = execWriter (hmapM p collect x)
Hence ix0 := ix
r0 := r
f0 := PF s
- phi0 := s2 ix2
+ phi0 := (->) s2 ix2
m0 := Writer [AnyF s]
a0 : = f0 r'0 ix0
- (forall ixx. (s2 ix2 ixx -> r ixx -> Writer [AnyF s] (r'0 ixx) ~ s ix))
- s2 ix2 ix0 ~ s2 ix2 -> r2 ix2 -> Writer [AnyF s2] (r2 ix2)
+ (forall ixx. ((->) (s2 ix2 -> ixx) (r ixx -> Writer [AnyF s] (r'0 ixx)) ~ s ix))
+
+ s2 ix2 ix0 ~ (->) (s2 ix2) (r2 ix2 -> Writer [AnyF s2] (r2 ix2))
-}
diff --git a/testsuite/tests/indexed-types/should_fail/T3330a.stderr b/testsuite/tests/indexed-types/should_fail/T3330a.stderr
index 0950875229..ffda424227 100644
--- a/testsuite/tests/indexed-types/should_fail/T3330a.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T3330a.stderr
@@ -1,37 +1,37 @@
-
-T3330a.hs:19:34: error:
- • Couldn't match type ‘ix’
- with ‘r ix1 -> Writer [AnyF s] (r'0 ix1)’
- ‘ix’ is a rigid type variable bound by
- the type signature for:
- children :: forall (s :: * -> *) ix (r :: * -> *).
- s ix -> PF s r ix -> [AnyF s]
- at T3330a.hs:18:13
- Expected type: (s0 ix0 -> ix1)
- -> r ix1 -> Writer [AnyF s] (r'0 ix1)
- Actual type: s ix
- • In the first argument of ‘hmapM’, namely ‘p’
- In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
- In the expression: execWriter (hmapM p collect x)
- • Relevant bindings include
- x :: PF s r ix (bound at T3330a.hs:19:12)
- p :: s ix (bound at T3330a.hs:19:10)
- children :: s ix -> PF s r ix -> [AnyF s] (bound at T3330a.hs:19:1)
-
-T3330a.hs:19:44: error:
- • Couldn't match type ‘ix’
- with ‘r0 ix0 -> Writer [AnyF s0] (r0 ix0)’
- ‘ix’ is a rigid type variable bound by
- the type signature for:
- children :: forall (s :: * -> *) ix (r :: * -> *).
- s ix -> PF s r ix -> [AnyF s]
- at T3330a.hs:18:13
- Expected type: PF s r (r0 ix0 -> Writer [AnyF s0] (r0 ix0))
- Actual type: PF s r ix
- • In the third argument of ‘hmapM’, namely ‘x’
- In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
- In the expression: execWriter (hmapM p collect x)
- • Relevant bindings include
- x :: PF s r ix (bound at T3330a.hs:19:12)
- p :: s ix (bound at T3330a.hs:19:10)
- children :: s ix -> PF s r ix -> [AnyF s] (bound at T3330a.hs:19:1)
+
+T3330a.hs:19:34: error:
+ • Couldn't match type ‘ix’
+ with ‘r ix1 -> Writer [AnyF s] (r'0 ix1)’
+ ‘ix’ is a rigid type variable bound by
+ the type signature for:
+ children :: forall (s :: * -> *) ix (r :: * -> *).
+ s ix -> PF s r ix -> [AnyF s]
+ at T3330a.hs:18:1-43
+ Expected type: (s0 ix0 -> ix1)
+ -> r ix1 -> Writer [AnyF s] (r'0 ix1)
+ Actual type: s ix
+ • In the first argument of ‘hmapM’, namely ‘p’
+ In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
+ In the expression: execWriter (hmapM p collect x)
+ • Relevant bindings include
+ x :: PF s r ix (bound at T3330a.hs:19:12)
+ p :: s ix (bound at T3330a.hs:19:10)
+ children :: s ix -> PF s r ix -> [AnyF s] (bound at T3330a.hs:19:1)
+
+T3330a.hs:19:44: error:
+ • Couldn't match type ‘ix’
+ with ‘r0 ix0 -> Writer [AnyF s0] (r0 ix0)’
+ ‘ix’ is a rigid type variable bound by
+ the type signature for:
+ children :: forall (s :: * -> *) ix (r :: * -> *).
+ s ix -> PF s r ix -> [AnyF s]
+ at T3330a.hs:18:1-43
+ Expected type: PF s r (r0 ix0 -> Writer [AnyF s0] (r0 ix0))
+ Actual type: PF s r ix
+ • In the third argument of ‘hmapM’, namely ‘x’
+ In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
+ In the expression: execWriter (hmapM p collect x)
+ • Relevant bindings include
+ x :: PF s r ix (bound at T3330a.hs:19:12)
+ p :: s ix (bound at T3330a.hs:19:10)
+ children :: s ix -> PF s r ix -> [AnyF s] (bound at T3330a.hs:19:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T3440.stderr b/testsuite/tests/indexed-types/should_fail/T3440.stderr
index 8289d144c2..84eb475b23 100644
--- a/testsuite/tests/indexed-types/should_fail/T3440.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T3440.stderr
@@ -1,24 +1,24 @@
-
-T3440.hs:11:22: error:
- • Could not deduce: a1 ~ a
- from the context: Fam a ~ Fam a1
- bound by a pattern with constructor:
- GADT :: forall a. a -> Fam a -> GADT (Fam a),
- in an equation for ‘unwrap’
- at T3440.hs:11:9-16
- ‘a1’ is a rigid type variable bound by
- a pattern with constructor:
- GADT :: forall a. a -> Fam a -> GADT (Fam a),
- in an equation for ‘unwrap’
- at T3440.hs:11:9
- ‘a’ is a rigid type variable bound by
- the type signature for:
- unwrap :: forall a. GADT (Fam a) -> (a, Fam a)
- at T3440.hs:10:11
- • In the expression: x
- In the expression: (x, y)
- In an equation for ‘unwrap’: unwrap (GADT x y) = (x, y)
- • Relevant bindings include
- y :: Fam a1 (bound at T3440.hs:11:16)
- x :: a1 (bound at T3440.hs:11:14)
- unwrap :: GADT (Fam a) -> (a, Fam a) (bound at T3440.hs:11:1)
+
+T3440.hs:11:22: error:
+ • Could not deduce: a1 ~ a
+ from the context: Fam a ~ Fam a1
+ bound by a pattern with constructor:
+ GADT :: forall a. a -> Fam a -> GADT (Fam a),
+ in an equation for ‘unwrap’
+ at T3440.hs:11:9-16
+ ‘a1’ is a rigid type variable bound by
+ a pattern with constructor:
+ GADT :: forall a. a -> Fam a -> GADT (Fam a),
+ in an equation for ‘unwrap’
+ at T3440.hs:11:9-16
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ unwrap :: forall a. GADT (Fam a) -> (a, Fam a)
+ at T3440.hs:10:1-36
+ • In the expression: x
+ In the expression: (x, y)
+ In an equation for ‘unwrap’: unwrap (GADT x y) = (x, y)
+ • Relevant bindings include
+ y :: Fam a1 (bound at T3440.hs:11:16)
+ x :: a1 (bound at T3440.hs:11:14)
+ unwrap :: GADT (Fam a) -> (a, Fam a) (bound at T3440.hs:11:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T4093a.stderr b/testsuite/tests/indexed-types/should_fail/T4093a.stderr
index d226122614..3ce9158bdc 100644
--- a/testsuite/tests/indexed-types/should_fail/T4093a.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4093a.stderr
@@ -1,16 +1,16 @@
-
-T4093a.hs:8:8: error:
- • Could not deduce: e ~ ()
- from the context: Foo e ~ Maybe e
- bound by the type signature for:
- hang :: Foo e ~ Maybe e => Foo e
- at T4093a.hs:7:1-34
- ‘e’ is a rigid type variable bound by
- the type signature for:
- hang :: forall e. Foo e ~ Maybe e => Foo e
- at T4093a.hs:7:9
- Expected type: Foo e
- Actual type: Maybe ()
- • In the expression: Just ()
- In an equation for ‘hang’: hang = Just ()
- • Relevant bindings include hang :: Foo e (bound at T4093a.hs:8:1)
+
+T4093a.hs:8:8: error:
+ • Could not deduce: e ~ ()
+ from the context: Foo e ~ Maybe e
+ bound by the type signature for:
+ hang :: Foo e ~ Maybe e => Foo e
+ at T4093a.hs:7:1-34
+ ‘e’ is a rigid type variable bound by
+ the type signature for:
+ hang :: forall e. Foo e ~ Maybe e => Foo e
+ at T4093a.hs:7:1-34
+ Expected type: Foo e
+ Actual type: Maybe ()
+ • In the expression: Just ()
+ In an equation for ‘hang’: hang = Just ()
+ • Relevant bindings include hang :: Foo e (bound at T4093a.hs:8:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T4093b.stderr b/testsuite/tests/indexed-types/should_fail/T4093b.stderr
index 0950de8c66..92530d58bf 100644
--- a/testsuite/tests/indexed-types/should_fail/T4093b.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4093b.stderr
@@ -1,42 +1,42 @@
-
-T4093b.hs:31:13: error:
- • Could not deduce: e ~ C
- from the context: (EitherCO e (A C O n) (A O O n) ~ A e O n,
- EitherCO x (A C C n) (A C O n) ~ A C x n)
- bound by the type signature for:
- blockToNodeList :: (EitherCO e (A C O n) (A O O n) ~ A e O n,
- EitherCO x (A C C n) (A C O n) ~ A C x n) =>
- Block n e x -> A e x n
- at T4093b.hs:(19,1)-(22,26)
- ‘e’ is a rigid type variable bound by
- the type signature for:
- blockToNodeList :: forall (n :: * -> * -> *) e x.
- (EitherCO e (A C O n) (A O O n) ~ A e O n,
- EitherCO x (A C C n) (A C O n) ~ A C x n) =>
- Block n e x -> A e x n
- at T4093b.hs:20:12
- Expected type: EitherCO e (A C O n) (A O O n)
- Actual type: (MaybeC C (n C O), MaybeC O (n O C))
- • In the expression: (JustC n, NothingC)
- In an equation for ‘f’: f n _ = (JustC n, NothingC)
- In an equation for ‘blockToNodeList’:
- blockToNodeList b
- = foldBlockNodesF (f, l) b z
- where
- z ::
- EitherCO e (EitherCO e (A C O n) (A O O n)) (EitherCO e (A C O n) (A O O n))
- z = undefined
- f ::
- n C O
- -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
- f n _ = (JustC n, NothingC)
- ....
- • Relevant bindings include
- f :: n C O
- -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
- (bound at T4093b.hs:31:5)
- l :: n O C
- -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C C n) (A O C n)
- (bound at T4093b.hs:34:5)
- b :: Block n e x (bound at T4093b.hs:25:17)
- blockToNodeList :: Block n e x -> A e x n (bound at T4093b.hs:25:1)
+
+T4093b.hs:31:13: error:
+ • Could not deduce: e ~ C
+ from the context: (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n)
+ bound by the type signature for:
+ blockToNodeList :: (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n) =>
+ Block n e x -> A e x n
+ at T4093b.hs:(19,1)-(22,26)
+ ‘e’ is a rigid type variable bound by
+ the type signature for:
+ blockToNodeList :: forall (n :: * -> * -> *) e x.
+ (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n) =>
+ Block n e x -> A e x n
+ at T4093b.hs:(19,1)-(22,26)
+ Expected type: EitherCO e (A C O n) (A O O n)
+ Actual type: (MaybeC C (n C O), MaybeC O (n O C))
+ • In the expression: (JustC n, NothingC)
+ In an equation for ‘f’: f n _ = (JustC n, NothingC)
+ In an equation for ‘blockToNodeList’:
+ blockToNodeList b
+ = foldBlockNodesF (f, l) b z
+ where
+ z ::
+ EitherCO e (EitherCO e (A C O n) (A O O n)) (EitherCO e (A C O n) (A O O n))
+ z = undefined
+ f ::
+ n C O
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
+ f n _ = (JustC n, NothingC)
+ ....
+ • Relevant bindings include
+ f :: n C O
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
+ (bound at T4093b.hs:31:5)
+ l :: n O C
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C C n) (A O C n)
+ (bound at T4093b.hs:34:5)
+ b :: Block n e x (bound at T4093b.hs:25:17)
+ blockToNodeList :: Block n e x -> A e x n (bound at T4093b.hs:25:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T4174.stderr b/testsuite/tests/indexed-types/should_fail/T4174.stderr
index c932530e5a..7fe8c704b9 100644
--- a/testsuite/tests/indexed-types/should_fail/T4174.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4174.stderr
@@ -1,16 +1,16 @@
-
-T4174.hs:42:12: error:
- • Couldn't match type ‘b’ with ‘RtsSpinLock’
- ‘b’ is a rigid type variable bound by
- the type signature for:
- testcase :: forall (m :: * -> *) minor n t p a b.
- Monad m =>
- m (Field (Way (GHC6'8 minor) n t p) a b)
- at T4174.hs:41:13
- Expected type: m (Field (Way (GHC6'8 minor) n t p) a b)
- Actual type: m (Field (WayOf m) SmStep RtsSpinLock)
- • In the expression: sync_large_objects
- In an equation for ‘testcase’: testcase = sync_large_objects
- • Relevant bindings include
- testcase :: m (Field (Way (GHC6'8 minor) n t p) a b)
- (bound at T4174.hs:42:1)
+
+T4174.hs:42:12: error:
+ • Couldn't match type ‘b’ with ‘RtsSpinLock’
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ testcase :: forall (m :: * -> *) minor n t p a b.
+ Monad m =>
+ m (Field (Way (GHC6'8 minor) n t p) a b)
+ at T4174.hs:41:1-63
+ Expected type: m (Field (Way (GHC6'8 minor) n t p) a b)
+ Actual type: m (Field (WayOf m) SmStep RtsSpinLock)
+ • In the expression: sync_large_objects
+ In an equation for ‘testcase’: testcase = sync_large_objects
+ • Relevant bindings include
+ testcase :: m (Field (Way (GHC6'8 minor) n t p) a b)
+ (bound at T4174.hs:42:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T4272.stderr b/testsuite/tests/indexed-types/should_fail/T4272.stderr
index a3b750a459..49a6e9f6c9 100644
--- a/testsuite/tests/indexed-types/should_fail/T4272.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4272.stderr
@@ -1,17 +1,17 @@
-
-T4272.hs:15:26: error:
- • Couldn't match type ‘a’ with ‘TermFamily a a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- laws :: forall a b. TermLike a => TermFamily a a -> b
- at T4272.hs:14:16
- Expected type: TermFamily a (TermFamily a a)
- Actual type: TermFamily a a
- • In the first argument of ‘terms’, namely
- ‘(undefined :: TermFamily a a)’
- In the second argument of ‘prune’, namely
- ‘(terms (undefined :: TermFamily a a))’
- In the expression: prune t (terms (undefined :: TermFamily a a))
- • Relevant bindings include
- t :: TermFamily a a (bound at T4272.hs:15:6)
- laws :: TermFamily a a -> b (bound at T4272.hs:15:1)
+
+T4272.hs:15:26: error:
+ • Couldn't match type ‘a’ with ‘TermFamily a a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ laws :: forall a b. TermLike a => TermFamily a a -> b
+ at T4272.hs:14:1-53
+ Expected type: TermFamily a (TermFamily a a)
+ Actual type: TermFamily a a
+ • In the first argument of ‘terms’, namely
+ ‘(undefined :: TermFamily a a)’
+ In the second argument of ‘prune’, namely
+ ‘(terms (undefined :: TermFamily a a))’
+ In the expression: prune t (terms (undefined :: TermFamily a a))
+ • Relevant bindings include
+ t :: TermFamily a a (bound at T4272.hs:15:6)
+ laws :: TermFamily a a -> b (bound at T4272.hs:15:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T7786.stderr b/testsuite/tests/indexed-types/should_fail/T7786.stderr
index a58b69e7e7..79230e1555 100644
--- a/testsuite/tests/indexed-types/should_fail/T7786.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7786.stderr
@@ -1,36 +1,50 @@
-
-T7786.hs:86:22: error:
- • Couldn't match type ‘xxx’ with ‘'Empty’
- Inaccessible code in
- a pattern with constructor: Nil :: forall a. Sing 'Empty,
- in a pattern binding in
- 'do' block
- • In the pattern: Nil
- In the pattern: Nil :: Sing xxx
- In a stmt of a 'do' block:
- Nil :: Sing xxx <- return
- (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)
-
-T7786.hs:86:49: error:
- • Couldn't match type ‘xxx’
- with ‘Intersect (BuriedUnder sub k 'Empty) inv’
- Expected type: Sing xxx
- Actual type: Sing (Intersect (BuriedUnder sub k 'Empty) inv)
- • In the first argument of ‘return’, namely
- ‘(buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)’
- In a stmt of a 'do' block:
- Nil :: Sing xxx <- return
- (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)
- In the expression:
- do { Nil :: Sing xxx <- return
- (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db);
- return $ Sub db k sub }
- • Relevant bindings include
- sub :: Database sub (bound at T7786.hs:86:13)
- k :: Sing k (bound at T7786.hs:86:11)
- db :: Database inv (bound at T7786.hs:86:8)
- addSub :: Database inv
- -> Sing k
- -> Database sub
- -> Maybe (Database (BuriedUnder sub k inv))
- (bound at T7786.hs:86:1)
+
+T7786.hs:86:49: error:
+ • Couldn't match type ‘xxx’
+ with ‘Intersect (BuriedUnder sub k 'Empty) inv’
+ Expected type: Sing xxx
+ Actual type: Sing (Intersect (BuriedUnder sub k 'Empty) inv)
+ • In the first argument of ‘return’, namely
+ ‘(buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)’
+ In a stmt of a 'do' block:
+ Nil :: Sing xxx <- return
+ (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)
+ In the expression:
+ do { Nil :: Sing xxx <- return
+ (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db);
+ return $ Sub db k sub }
+ • Relevant bindings include
+ sub :: Database sub (bound at T7786.hs:86:13)
+ k :: Sing k (bound at T7786.hs:86:11)
+ db :: Database inv (bound at T7786.hs:86:8)
+ addSub :: Database inv
+ -> Sing k
+ -> Database sub
+ -> Maybe (Database (BuriedUnder sub k inv))
+ (bound at T7786.hs:86:1)
+
+T7786.hs:90:31: error:
+ • Could not deduce: Intersect (BuriedUnder sub k 'Empty) inv
+ ~
+ 'Empty
+ arising from a use of ‘Sub’
+ from the context: xxx ~ 'Empty
+ bound by a pattern with constructor: Nil :: forall a. Sing 'Empty,
+ in a pattern binding in
+ 'do' block
+ at T7786.hs:86:22-24
+ • In the second argument of ‘($)’, namely ‘Sub db k sub’
+ In a stmt of a 'do' block: return $ Sub db k sub
+ In the expression:
+ do { Nil :: Sing xxx <- return
+ (buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db);
+ return $ Sub db k sub }
+ • Relevant bindings include
+ sub :: Database sub (bound at T7786.hs:86:13)
+ k :: Sing k (bound at T7786.hs:86:11)
+ db :: Database inv (bound at T7786.hs:86:8)
+ addSub :: Database inv
+ -> Sing k
+ -> Database sub
+ -> Maybe (Database (BuriedUnder sub k inv))
+ (bound at T7786.hs:86:1)
diff --git a/testsuite/tests/indexed-types/should_fail/T9662.stderr b/testsuite/tests/indexed-types/should_fail/T9662.stderr
index 04ba4f4dba..403f769dfd 100644
--- a/testsuite/tests/indexed-types/should_fail/T9662.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T9662.stderr
@@ -1,35 +1,35 @@
-
-T9662.hs:47:8: error:
- • Couldn't match type ‘n’ with ‘Int’
- ‘n’ is a rigid type variable bound by
- the type signature for:
- test :: forall sh k m n.
- Shape (((sh :. k) :. m) :. n) -> Shape (((sh :. m) :. n) :. k)
- at T9662.hs:44:9
- Expected type: Exp (((sh :. m) :. n) :. k)
- -> Exp (((sh :. m) :. n) :. k)
- Actual type: Exp
- (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
- -> Exp
- (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
- • In the first argument of ‘backpermute’, namely
- ‘(modify
- (atom :. atom :. atom :. atom)
- (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))’
- In the expression:
- backpermute
- (modify
- (atom :. atom :. atom :. atom)
- (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
- id
- In an equation for ‘test’:
- test
- = backpermute
- (modify
- (atom :. atom :. atom :. atom)
- (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
- id
- • Relevant bindings include
- test :: Shape (((sh :. k) :. m) :. n)
- -> Shape (((sh :. m) :. n) :. k)
- (bound at T9662.hs:45:1)
+
+T9662.hs:47:8: error:
+ • Couldn't match type ‘n’ with ‘Int’
+ ‘n’ is a rigid type variable bound by
+ the type signature for:
+ test :: forall sh k m n.
+ Shape (((sh :. k) :. m) :. n) -> Shape (((sh :. m) :. n) :. k)
+ at T9662.hs:44:1-50
+ Expected type: Exp (((sh :. m) :. n) :. k)
+ -> Exp (((sh :. m) :. n) :. k)
+ Actual type: Exp
+ (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
+ -> Exp
+ (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
+ • In the first argument of ‘backpermute’, namely
+ ‘(modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))’
+ In the expression:
+ backpermute
+ (modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
+ id
+ In an equation for ‘test’:
+ test
+ = backpermute
+ (modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
+ id
+ • Relevant bindings include
+ test :: Shape (((sh :. k) :. m) :. n)
+ -> Shape (((sh :. m) :. n) :. k)
+ (bound at T9662.hs:45:1)
diff --git a/testsuite/tests/module/mod71.stderr b/testsuite/tests/module/mod71.stderr
index d02aac28fa..f0f43d8df6 100644
--- a/testsuite/tests/module/mod71.stderr
+++ b/testsuite/tests/module/mod71.stderr
@@ -1,12 +1,12 @@
-
-mod71.hs:4:9: error:
- • Found hole: _ :: t1
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of f :: Num t => (t1 -> t -> t2) -> t2
- at mod71.hs:4:1
- • In the first argument of ‘x’, namely ‘_’
- In the expression: x _ 1
- In an equation for ‘f’: f x = x _ 1
- • Relevant bindings include
- x :: t1 -> t -> t2 (bound at mod71.hs:4:3)
- f :: (t1 -> t -> t2) -> t2 (bound at mod71.hs:4:1)
+
+mod71.hs:4:9: error:
+ • Found hole: _ :: t1
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of f :: Num t => (t1 -> t -> t2) -> t2
+ at mod71.hs:4:1-11
+ • In the first argument of ‘x’, namely ‘_’
+ In the expression: x _ 1
+ In an equation for ‘f’: f x = x _ 1
+ • Relevant bindings include
+ x :: t1 -> t -> t2 (bound at mod71.hs:4:3)
+ f :: (t1 -> t -> t2) -> t2 (bound at mod71.hs:4:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
index 505e5ae659..097bb88829 100644
--- a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
@@ -1,7 +1,7 @@
-TYPE SIGNATURES
- bravo :: forall t. Num t => t
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.1]
+TYPE SIGNATURES
+ bravo :: forall w. Num w => w
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
index 7e40fd184b..097bb88829 100644
--- a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
@@ -1,7 +1,7 @@
-TYPE SIGNATURES
- bravo :: forall t. Num t => t
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.0]
+TYPE SIGNATURES
+ bravo :: forall w. Num w => w
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/Either.stderr b/testsuite/tests/partial-sigs/should_compile/Either.stderr
index 53988619d9..2843775174 100644
--- a/testsuite/tests/partial-sigs/should_compile/Either.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/Either.stderr
@@ -1,7 +1,7 @@
-TYPE SIGNATURES
- barry :: forall t. t -> (Either [Char] t, Either [Char] t)
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.1]
+TYPE SIGNATURES
+ barry :: forall w. w -> (Either [Char] w, Either [Char] w)
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr b/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
index 3bb47befd4..29a6506979 100644
--- a/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
@@ -1,7 +1,7 @@
-TYPE SIGNATURES
- every :: forall t. (t -> Bool) -> [t] -> Bool
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.1]
+TYPE SIGNATURES
+ every :: forall w. (w -> Bool) -> [w] -> Bool
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr
index 5a3f40f353..b94e0c5c17 100644
--- a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr
@@ -1,19 +1,17 @@
-
-ExprSigLocal.hs:9:35: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘a’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of <expression> :: a -> a at ExprSigLocal.hs:9:27
- • In an expression type signature: forall a. a -> _
- In the expression: ((\ x -> x) :: forall a. a -> _)
- In an equation for ‘y’: y = ((\ x -> x) :: forall a. a -> _)
- • Relevant bindings include
- y :: b -> b (bound at ExprSigLocal.hs:9:1)
-
-ExprSigLocal.hs:11:21: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘a’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of g :: a -> a at ExprSigLocal.hs:11:13
- • In the type signature:
- g :: forall a. a -> _
- • Relevant bindings include
- g :: a -> a (bound at ExprSigLocal.hs:12:1)
+
+ExprSigLocal.hs:9:35: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of <expression> :: a -> a
+ at ExprSigLocal.hs:9:20-35
+ • In an expression type signature: forall a. a -> _
+ In the expression: ((\ x -> x) :: forall a. a -> _)
+ In an equation for ‘y’: y = ((\ x -> x) :: forall a. a -> _)
+ • Relevant bindings include
+ y :: b -> b (bound at ExprSigLocal.hs:9:1)
+
+ExprSigLocal.hs:11:21: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of g :: a -> a at ExprSigLocal.hs:12:1-7
+ • In the type signature: g :: forall a. a -> _
diff --git a/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr b/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
index 60de114c99..2526f72019 100644
--- a/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
@@ -125,12 +125,12 @@ TYPE SIGNATURES
(Monad m, P.Foldable t) =>
(a -> m b) -> t a -> m ()
max :: forall a. Ord a => a -> a -> a
- maxBound :: forall t. Bounded t => t
+ maxBound :: forall w. Bounded w => w
maximum ::
forall (t :: * -> *) a. (Ord a, P.Foldable t) => t a -> a
maybe :: forall a b. b -> (a -> b) -> Maybe a -> b
min :: forall a. Ord a => a -> a -> a
- minBound :: forall t. Bounded t => t
+ minBound :: forall w. Bounded w => w
minimum ::
forall (t :: * -> *) a. (Ord a, P.Foldable t) => t a -> a
mod :: forall a. Integral a => a -> a -> a
@@ -142,7 +142,7 @@ TYPE SIGNATURES
odd :: forall a. Integral a => a -> Bool
or :: forall (t :: * -> *). P.Foldable t => t Bool -> Bool
otherwise :: Bool
- pi :: forall t. Floating t => t
+ pi :: forall w. Floating w => w
pred :: forall a. Enum a => a -> a
print :: forall a. Show a => a -> IO ()
product ::
@@ -212,7 +212,7 @@ TYPE SIGNATURES
toRational :: forall a. Real a => a -> Rational
truncate :: forall b a. (Integral b, RealFrac a) => a -> b
uncurry :: forall c b a. (a -> b -> c) -> (a, b) -> c
- undefined :: forall t. t
+ undefined :: forall w. w
unlines :: [String] -> String
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
unwords :: [String] -> String
diff --git a/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr b/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
index db0adb2004..1adc0b055c 100644
--- a/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
@@ -1,7 +1,7 @@
-TYPE SIGNATURES
- bar :: forall t. t -> Bool
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.1]
+TYPE SIGNATURES
+ bar :: forall w. w -> Bool
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
index abc5f44138..2c84971275 100644
--- a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
@@ -1,100 +1,79 @@
-[1 of 2] Compiling Splices ( Splices.hs, Splices.o )
-[2 of 2] Compiling SplicesUsed ( SplicesUsed.hs, SplicesUsed.o )
-
-SplicesUsed.hs:7:16: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Maybe Bool’
- • In the type signature:
- maybeBool :: _
- • Relevant bindings include
- maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
-
-SplicesUsed.hs:8:15: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_a’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of <expression> :: t -> t at SplicesUsed.hs:8:15
- • In an expression type signature: _a -> _a
- In the expression: id :: _a -> _a
- In the expression: (id :: _a -> _a) (Just True :: Maybe _)
- • Relevant bindings include
- maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
-
-SplicesUsed.hs:8:27: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Bool’
- • In an expression type signature: Maybe _
- In the first argument of ‘id :: _a -> _a’, namely
- ‘(Just True :: Maybe _)’
- In the expression: (id :: _a -> _a) (Just True :: Maybe _)
- • Relevant bindings include
- maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
-
-SplicesUsed.hs:10:17: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘(Char, a)’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of charA :: a -> (Char, a)
- at SplicesUsed.hs:10:10
- • In the type signature:
- charA :: a -> (_)
- • Relevant bindings include
- charA :: a -> (Char, a) (bound at SplicesUsed.hs:11:1)
-
-SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘a -> Bool’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
- at SplicesUsed.hs:14:1
- • In the type signature:
- filter' :: _ -> _ -> _
- • Relevant bindings include
- filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1)
-
-SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘[a]’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
- at SplicesUsed.hs:14:1
- • In the type signature:
- filter' :: _ -> _ -> _
- • Relevant bindings include
- filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1)
-
-SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘[a]’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
- at SplicesUsed.hs:14:1
- • In the type signature:
- filter' :: _ -> _ -> _
- • Relevant bindings include
- filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1)
-
-SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘Eq a’
- In the type signature:
- foo :: _ => _
-
-SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of foo :: Eq a => a -> a -> Bool
- at SplicesUsed.hs:16:3
- • In the type signature:
- foo :: _ => _
- • Relevant bindings include
- foo :: a -> a -> Bool (bound at SplicesUsed.hs:16:3)
-
-SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_a’ standing for ‘Bool’
- • In the type signature:
- bar :: _a -> _b -> (_a, _b)
- • Relevant bindings include
- bar :: Bool -> t -> (Bool, t) (bound at SplicesUsed.hs:18:3)
-
-SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_b’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Bool -> t -> (Bool, t)
- at SplicesUsed.hs:18:3
- • In the type signature:
- bar :: _a -> _b -> (_a, _b)
- • Relevant bindings include
- bar :: Bool -> t -> (Bool, t) (bound at SplicesUsed.hs:18:3)
+[1 of 2] Compiling Splices ( Splices.hs, Splices.o )
+[2 of 2] Compiling SplicesUsed ( SplicesUsed.hs, SplicesUsed.o )
+
+SplicesUsed.hs:7:16: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Maybe Bool’
+ • In the type signature: maybeBool :: _
+
+SplicesUsed.hs:8:15: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: w -> w
+ at SplicesUsed.hs:8:15-22
+ • In an expression type signature: _a -> _a
+ In the expression: id :: _a -> _a
+ In the expression: (id :: _a -> _a) (Just True :: Maybe _)
+ • Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
+
+SplicesUsed.hs:8:27: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ • In an expression type signature: Maybe _
+ In the first argument of ‘id :: _a -> _a’, namely
+ ‘(Just True :: Maybe _)’
+ In the expression: (id :: _a -> _a) (Just True :: Maybe _)
+ • Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
+
+SplicesUsed.hs:10:17: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(Char, a)’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of charA :: a -> (Char, a)
+ at SplicesUsed.hs:11:1-18
+ • In the type signature: charA :: a -> (_)
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> Bool’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘[a]’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘[a]’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at SplicesUsed.hs:16:3-10
+ • In the type signature: foo :: _ => _
+
+SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at SplicesUsed.hs:16:3-10
+ • In the type signature: foo :: _ => _
+
+SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ • In the type signature: bar :: _a -> _b -> (_a, _b)
+
+SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_b’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Bool -> w -> (Bool, w)
+ at SplicesUsed.hs:18:3-10
+ • In the type signature: bar :: _a -> _b -> (_a, _b)
diff --git a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr
index d6fda4e8f5..7811dcb854 100644
--- a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr
@@ -1,4 +1,4 @@
-
-SuperCls.hs:4:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘()’
- In the type signature: f :: (Ord a, _) => a -> Bool
+
+SuperCls.hs:4:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘() :: Constraint’
+ • In the type signature: f :: (Ord a, _) => a -> Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
index 320b28b621..753b983a15 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -1,81 +1,77 @@
-
-T10403.hs:15:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘Functor f’
- In the type signature:
- h1 :: _ => _
-
-T10403.hs:15:12: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’
- Where: ‘f’ is a rigid type variable bound by
- the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:17:1
- ‘b’ is a rigid type variable bound by
- the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:17:1
- ‘a’ is a rigid type variable bound by
- the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
- at T10403.hs:17:1
- • In the type signature:
- h1 :: _ => _
- • Relevant bindings include
- h1 :: (a -> b) -> f a -> H f (bound at T10403.hs:17:1)
-
-T10403.hs:19:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘(a -> b) -> f0 a -> H f0’
- Where: ‘f0’ is an ambiguous type variable
- ‘b’ is a rigid type variable bound by
- the inferred type of h2 :: (a -> b) -> f0 a -> H f0
- at T10403.hs:22:1
- ‘a’ is a rigid type variable bound by
- the inferred type of h2 :: (a -> b) -> f0 a -> H f0
- at T10403.hs:22:1
- • In the type signature:
- h2 :: _
- • Relevant bindings include
- h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1)
-
-T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
- prevents the constraint ‘(Functor f0)’ from being solved.
- Relevant bindings include
- b :: f0 a (bound at T10403.hs:22:6)
- h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1)
- Probable fix: use a type annotation to specify what ‘f0’ should be.
- These potential instances exist:
- instance Functor IO -- Defined in ‘GHC.Base’
- instance Functor (B t) -- Defined at T10403.hs:10:10
- instance Functor I -- Defined at T10403.hs:6:10
- ...plus four others
- (use -fprint-potential-instances to see them all)
- • In the second argument of ‘(.)’, namely ‘fmap (const ())’
- In the expression: H . fmap (const ())
- In the expression: (H . fmap (const ())) (fmap f b)
-
-T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘f0’ with ‘B t’
- because type variable ‘t’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for:
- app2 :: H (B t)
- at T10403.hs:27:1-15
- Expected type: H (B t)
- Actual type: H f0
- • In the expression: h2 (H . I) (B ())
- In an equation for ‘app2’: app2 = h2 (H . I) (B ())
- • Relevant bindings include
- app2 :: H (B t) (bound at T10403.hs:28:1)
-
-T10403.hs:28:20: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘f0’ with ‘B t’
- because type variable ‘t’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for:
- app2 :: H (B t)
- at T10403.hs:27:1-15
- Expected type: f0 ()
- Actual type: B t ()
- • In the second argument of ‘h2’, namely ‘(B ())’
- In the expression: h2 (H . I) (B ())
- In an equation for ‘app2’: app2 = h2 (H . I) (B ())
- • Relevant bindings include
- app2 :: H (B t) (bound at T10403.hs:28:1)
+
+T10403.hs:15:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Functor f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ • In the type signature: h1 :: _ => _
+
+T10403.hs:15:12: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ • In the type signature: h1 :: _ => _
+
+T10403.hs:19:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(a -> b) -> f0 a -> H f0’
+ Where: ‘f0’ is an ambiguous type variable
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h2 :: (a -> b) -> f0 a -> H f0
+ at T10403.hs:22:1-41
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h2 :: (a -> b) -> f0 a -> H f0
+ at T10403.hs:22:1-41
+ • In the type signature: h2 :: _
+
+T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
+ prevents the constraint ‘(Functor f0)’ from being solved.
+ Relevant bindings include
+ b :: f0 a (bound at T10403.hs:22:6)
+ h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1)
+ Probable fix: use a type annotation to specify what ‘f0’ should be.
+ These potential instances exist:
+ instance Functor IO -- Defined in ‘GHC.Base’
+ instance Functor (B t) -- Defined at T10403.hs:10:10
+ instance Functor I -- Defined at T10403.hs:6:10
+ ...plus four others
+ (use -fprint-potential-instances to see them all)
+ • In the second argument of ‘(.)’, namely ‘fmap (const ())’
+ In the expression: H . fmap (const ())
+ In the expression: (H . fmap (const ())) (fmap f b)
+
+T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘f0’ with ‘B t’
+ because type variable ‘t’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ app2 :: H (B t)
+ at T10403.hs:27:1-15
+ Expected type: H (B t)
+ Actual type: H f0
+ • In the expression: h2 (H . I) (B ())
+ In an equation for ‘app2’: app2 = h2 (H . I) (B ())
+ • Relevant bindings include
+ app2 :: H (B t) (bound at T10403.hs:28:1)
+
+T10403.hs:28:20: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘f0’ with ‘B t’
+ because type variable ‘t’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ app2 :: H (B t)
+ at T10403.hs:27:1-15
+ Expected type: f0 ()
+ Actual type: B t ()
+ • In the second argument of ‘h2’, namely ‘(B ())’
+ In the expression: h2 (H . I) (B ())
+ In an equation for ‘app2’: app2 = h2 (H . I) (B ())
+ • Relevant bindings include
+ app2 :: H (B t) (bound at T10403.hs:28:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10438.stderr b/testsuite/tests/partial-sigs/should_compile/T10438.stderr
index 0742250be3..a3fc19f7aa 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10438.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10438.stderr
@@ -1,28 +1,26 @@
-
-T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘t2’
- Where: ‘t2’ is a rigid type variable bound by
- the inferred type of g :: t2 -> t2 at T10438.hs:6:9
- • In the type signature:
- x :: _
- In an equation for ‘g’:
- g r
- = x
- where
- x :: _
- x = r
- In an equation for ‘foo’:
- foo f
- = g
- where
- g r
- = x
- where
- x :: _
- x = r
- • Relevant bindings include
- x :: t2 (bound at T10438.hs:8:17)
- r :: t2 (bound at T10438.hs:6:11)
- g :: t2 -> t2 (bound at T10438.hs:6:9)
- f :: t1 (bound at T10438.hs:5:5)
- foo :: t1 -> forall t. t -> t (bound at T10438.hs:5:1)
+
+T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t2’
+ Where: ‘t2’ is a rigid type variable bound by
+ the inferred type of g :: t2 -> t2 at T10438.hs:(6,9)-(8,21)
+ • In the type signature: x :: _
+ In an equation for ‘g’:
+ g r
+ = x
+ where
+ x :: _
+ x = r
+ In an equation for ‘foo’:
+ foo f
+ = g
+ where
+ g r
+ = x
+ where
+ x :: _
+ x = r
+ • Relevant bindings include
+ r :: t2 (bound at T10438.hs:6:11)
+ g :: t2 -> t2 (bound at T10438.hs:6:9)
+ f :: t1 (bound at T10438.hs:5:5)
+ foo :: t1 -> forall t. t -> t (bound at T10438.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10519.stderr b/testsuite/tests/partial-sigs/should_compile/T10519.stderr
index ba98d7a3b0..496867bd04 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10519.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10519.stderr
@@ -1,5 +1,7 @@
-
-T10519.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘Eq a’
- In the type signature:
- foo :: forall a. _ => a -> a -> Bool
+
+T10519.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at T10519.hs:6:1-16
+ • In the type signature: foo :: forall a. _ => a -> a -> Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T11016.stderr b/testsuite/tests/partial-sigs/should_compile/T11016.stderr
index 5d9ad095c1..faf2124b25 100644
--- a/testsuite/tests/partial-sigs/should_compile/T11016.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T11016.stderr
@@ -1,11 +1,8 @@
-
-T11016.hs:5:19: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘()’
- In the type signature:
- f1 :: (?x :: Int, _) => Int
-
-T11016.hs:8:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Int’
- • In the type signature:
- f2 :: (?x :: Int) => _
- • Relevant bindings include f2 :: Int (bound at T11016.hs:9:1)
+
+T11016.hs:5:19: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘() :: Constraint’
+ • In the type signature: f1 :: (?x :: Int, _) => Int
+
+T11016.hs:8:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int’
+ • In the type signature: f2 :: (?x :: Int) => _
diff --git a/testsuite/tests/partial-sigs/should_compile/T11192.stderr b/testsuite/tests/partial-sigs/should_compile/T11192.stderr
index 558097ca2b..c2a9db5a96 100644
--- a/testsuite/tests/partial-sigs/should_compile/T11192.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T11192.stderr
@@ -1,44 +1,38 @@
-
-T11192.hs:7:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Int -> t -> t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of go :: Int -> t -> t at T11192.hs:8:8
- • In the type signature:
- go :: _
- In the expression:
- let
- go :: _
- go 0 a = a
- in go (0 :: Int) undefined
- In an equation for ‘fails’:
- fails
- = let
- go :: _
- go 0 a = a
- in go (0 :: Int) undefined
- • Relevant bindings include
- go :: Int -> t -> t (bound at T11192.hs:8:8)
- fails :: a (bound at T11192.hs:6:1)
-
-T11192.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘t1 -> t -> t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of go :: t1 -> t -> t at T11192.hs:14:8
- ‘t1’ is a rigid type variable bound by
- the inferred type of go :: t1 -> t -> t at T11192.hs:14:8
- • In the type signature:
- go :: _
- In the expression:
- let
- go :: _
- go _ a = a
- in go (0 :: Int) undefined
- In an equation for ‘succeeds’:
- succeeds
- = let
- go :: _
- go _ a = a
- in go (0 :: Int) undefined
- • Relevant bindings include
- go :: t1 -> t -> t (bound at T11192.hs:14:8)
- succeeds :: a (bound at T11192.hs:12:1)
+
+T11192.hs:7:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int -> t -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of go :: Int -> t -> t at T11192.hs:8:8-17
+ • In the type signature: go :: _
+ In the expression:
+ let
+ go :: _
+ go 0 a = a
+ in go (0 :: Int) undefined
+ In an equation for ‘fails’:
+ fails
+ = let
+ go :: _
+ go 0 a = a
+ in go (0 :: Int) undefined
+ • Relevant bindings include fails :: a (bound at T11192.hs:6:1)
+
+T11192.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t1 -> t -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of go :: t1 -> t -> t at T11192.hs:14:8-17
+ ‘t1’ is a rigid type variable bound by
+ the inferred type of go :: t1 -> t -> t at T11192.hs:14:8-17
+ • In the type signature: go :: _
+ In the expression:
+ let
+ go :: _
+ go _ a = a
+ in go (0 :: Int) undefined
+ In an equation for ‘succeeds’:
+ succeeds
+ = let
+ go :: _
+ go _ a = a
+ in go (0 :: Int) undefined
+ • Relevant bindings include succeeds :: a (bound at T11192.hs:12:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T11339a.hs b/testsuite/tests/partial-sigs/should_compile/T11339a.hs
new file mode 100644
index 0000000000..de20d93d93
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T11339a.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+
+module T11399a where
+
+bar :: _
+(bar) = id
diff --git a/testsuite/tests/partial-sigs/should_compile/T11339a.stderr b/testsuite/tests/partial-sigs/should_compile/T11339a.stderr
new file mode 100644
index 0000000000..76d15ff356
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T11339a.stderr
@@ -0,0 +1,6 @@
+
+T11339a.hs:5:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of bar :: a -> a at T11339a.hs:6:1-10
+ • In the type signature: bar :: _
diff --git a/testsuite/tests/partial-sigs/should_compile/T11670.hs b/testsuite/tests/partial-sigs/should_compile/T11670.hs
new file mode 100644
index 0000000000..8b0611fda1
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T11670.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE InstanceSigs, PartialTypeSignatures #-}
+
+module T11670 where
+
+import Foreign.C.Types
+import Foreign.Storable
+import Foreign.Ptr
+
+peek :: Ptr a -> IO CLong
+peek ptr = peekElemOff undefined 0 :: IO _
+
+peek2 :: Ptr a -> IO CLong
+peek2 ptr = peekElemOff undefined 0 :: _ => IO _
+
+-- castPtr :: Ptr a -> Ptr b
+-- peekElemOff :: Storable a => Ptr a -> Int -> IO a
diff --git a/testsuite/tests/partial-sigs/should_compile/T11670.stderr b/testsuite/tests/partial-sigs/should_compile/T11670.stderr
new file mode 100644
index 0000000000..eaa304ca42
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T11670.stderr
@@ -0,0 +1,36 @@
+
+T11670.hs:10:42: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘CLong’
+ • In an expression type signature: IO _
+ In the expression: peekElemOff undefined 0 :: IO _
+ In an equation for ‘T11670.peek’:
+ T11670.peek ptr = peekElemOff undefined 0 :: IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:10:6)
+ peek :: Ptr a -> IO CLong (bound at T11670.hs:10:1)
+
+T11670.hs:13:40: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Storable w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: Storable w => IO w
+ at T11670.hs:13:40-48
+ • In an expression type signature: _ => IO _
+ In the expression: peekElemOff undefined 0 :: _ => IO _
+ In an equation for ‘peek2’:
+ peek2 ptr = peekElemOff undefined 0 :: _ => IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:13:7)
+ peek2 :: Ptr a -> IO CLong (bound at T11670.hs:13:1)
+
+T11670.hs:13:48: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: Storable w => IO w
+ at T11670.hs:13:40-48
+ • In an expression type signature: _ => IO _
+ In the expression: peekElemOff undefined 0 :: _ => IO _
+ In an equation for ‘peek2’:
+ peek2 ptr = peekElemOff undefined 0 :: _ => IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:13:7)
+ peek2 :: Ptr a -> IO CLong (bound at T11670.hs:13:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T12033.hs b/testsuite/tests/partial-sigs/should_compile/T12033.hs
new file mode 100644
index 0000000000..9d47ec6541
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T12033.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TypeFamilies, PartialTypeSignatures #-}
+
+-- In Trac #12033 this was called HsakellBug.hs
+
+module T12033 where
+tripleStoreToRuleSet :: v -> v
+tripleStoreToRuleSet getAtom
+ = makeTuple getAtom
+ where
+ makeRule v = makeExpression v
+ makeTuple v = makeExpression v
+ makeExpression :: _
+ makeExpression v = makeTuple getAtom
diff --git a/testsuite/tests/partial-sigs/should_compile/T12033.stderr b/testsuite/tests/partial-sigs/should_compile/T12033.stderr
new file mode 100644
index 0000000000..02a1233559
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T12033.stderr
@@ -0,0 +1,24 @@
+
+T12033.hs:12:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘v -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of
+ makeTuple :: v -> t
+ makeExpression :: v -> t
+ at T12033.hs:(11,4)-(13,39)
+ ‘v’ is a rigid type variable bound by
+ the type signature for:
+ tripleStoreToRuleSet :: forall v. v -> v
+ at T12033.hs:6:1-30
+ • In the type signature: makeExpression :: _
+ In an equation for ‘tripleStoreToRuleSet’:
+ tripleStoreToRuleSet getAtom
+ = makeTuple getAtom
+ where
+ makeRule v = makeExpression v
+ makeTuple v = makeExpression v
+ makeExpression :: _
+ makeExpression v = makeTuple getAtom
+ • Relevant bindings include
+ getAtom :: v (bound at T12033.hs:7:22)
+ tripleStoreToRuleSet :: v -> v (bound at T12033.hs:7:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr b/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
index be6dd3bdf0..bd9ac50bd7 100644
--- a/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
@@ -1,5 +1,5 @@
TYPE SIGNATURES
- unc :: forall t t1 t2. (t2 -> t1 -> t) -> (t2, t1) -> t
+ unc :: forall w w1 w2. (w2 -> w1 -> w) -> (w2, w1) -> w
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
diff --git a/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr b/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
index 8951f4490a..b73f5669a0 100644
--- a/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
@@ -1,5 +1,5 @@
TYPE SIGNATURES
- unc :: forall t b a. (a -> b -> t) -> (a, b) -> t
+ unc :: forall w b a. (a -> b -> w) -> (a, b) -> w
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
diff --git a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
index fe80ce4b7b..60b5b11bde 100644
--- a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
@@ -1,60 +1,50 @@
-TYPE SIGNATURES
- bar :: forall t t1. t1 -> (t1 -> t) -> t
- foo :: forall a. (Show a, Enum a) => a -> String
-TYPE CONSTRUCTORS
-COERCION AXIOMS
-Dependent modules: []
-Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
- integer-gmp-1.0.0.1]
-
-WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_a’ standing for ‘a’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of foo :: (Show a, Enum a) => a -> String
- at WarningWildcardInstantiations.hs:6:1
- • In the type signature: foo :: (Show _a, _) => _a -> _
- • Relevant bindings include
- foo :: a -> String (bound at WarningWildcardInstantiations.hs:6:1)
-
-WarningWildcardInstantiations.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
- Found constraint wildcard ‘_’ standing for ‘Enum a’
- In the type signature: foo :: (Show _a, _) => _a -> _
-
-WarningWildcardInstantiations.hs:5:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘String’
- • In the type signature: foo :: (Show _a, _) => _a -> _
- • Relevant bindings include
- foo :: a -> String (bound at WarningWildcardInstantiations.hs:6:1)
-
-WarningWildcardInstantiations.hs:8:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WarningWildcardInstantiations.hs:9:1
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WarningWildcardInstantiations.hs:9:1)
-
-WarningWildcardInstantiations.hs:8:13: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘t1 -> t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WarningWildcardInstantiations.hs:9:1
- ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WarningWildcardInstantiations.hs:9:1
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WarningWildcardInstantiations.hs:9:1)
-
-WarningWildcardInstantiations.hs:8:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WarningWildcardInstantiations.hs:9:1
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WarningWildcardInstantiations.hs:9:1)
+TYPE SIGNATURES
+ bar :: forall w t. t -> (t -> w) -> w
+ foo :: forall a. (Show a, Enum a) => a -> String
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
+
+WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WarningWildcardInstantiations.hs:6:1-21
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Enum a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WarningWildcardInstantiations.hs:6:1-21
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:5:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘String’
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:8:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
+
+WarningWildcardInstantiations.hs:8:13: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t -> w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
+
+WarningWildcardInstantiations.hs:8:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index 18895ad551..262bf7e794 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -60,4 +60,7 @@ test('T10463', normal, compile, [''])
test('ExprSigLocal', normal, compile, [''])
test('T11016', normal, compile, [''])
test('T11192', normal, compile, [''])
-test('SuperCls', normal, compile, ['']) \ No newline at end of file
+test('SuperCls', normal, compile, [''])
+test('T12033', normal, compile, [''])
+test('T11339a', normal, compile, [''])
+test('T11670', normal, compile, [''])
diff --git a/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr b/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr
index 460bc63a44..98fd37770b 100644
--- a/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr
@@ -1,7 +1,4 @@
-
-Defaulting1MROff.hs:7:10: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Integer’
- • In the type signature:
- alpha :: _
- • Relevant bindings include
- alpha :: Integer (bound at Defaulting1MROff.hs:8:1)
+
+Defaulting1MROff.hs:7:10: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Integer’
+ • In the type signature: alpha :: _
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs
index 8a7ce369e8..ed653c1f64 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+
module ExtraConstraintsWildcardInExpressionSignature where
foo x y = ((==) :: _ => _) x y
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
index 9f04fc2cf2..b634ec4eb7 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
@@ -1,4 +1,32 @@
-
-ExtraConstraintsWildcardInExpressionSignature.hs:3:20: error:
- Extra-constraint wildcard ‘_’ not allowed
- in an expression type signature
+
+ExtraConstraintsWildcardInExpressionSignature.hs:5:20: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a1’
+ Where: ‘a1’ is a rigid type variable bound by
+ the inferred type of <expression> :: Eq a1 => a1 -> a1 -> Bool
+ at ExtraConstraintsWildcardInExpressionSignature.hs:5:20-25
+ • In an expression type signature: _ => _
+ In the expression: (==) :: _ => _
+ In the expression: ((==) :: _ => _) x y
+ • Relevant bindings include
+ y :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:7)
+ x :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:5)
+ foo :: a -> a -> Bool
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:1)
+
+ExtraConstraintsWildcardInExpressionSignature.hs:5:25: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a1 -> a1 -> Bool’
+ Where: ‘a1’ is a rigid type variable bound by
+ the inferred type of <expression> :: Eq a1 => a1 -> a1 -> Bool
+ at ExtraConstraintsWildcardInExpressionSignature.hs:5:20-25
+ • In an expression type signature: _ => _
+ In the expression: (==) :: _ => _
+ In the expression: ((==) :: _ => _) x y
+ • Relevant bindings include
+ y :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:7)
+ x :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:5)
+ foo :: a -> a -> Bool
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr
index d1dee083dd..0790605837 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr
@@ -1,6 +1,8 @@
-
-ExtraConstraintsWildcardNotEnabled.hs:4:10: error:
- Found constraint wildcard ‘_’ standing for ‘Show a’
- To use the inferred type, enable PartialTypeSignatures
- In the type signature:
- show' :: _ => a -> String
+
+ExtraConstraintsWildcardNotEnabled.hs:4:10: error:
+ • Found type wildcard ‘_’ standing for ‘Show a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of show' :: Show a => a -> String
+ at ExtraConstraintsWildcardNotEnabled.hs:5:1-16
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: show' :: _ => a -> String
diff --git a/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr b/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
index 2df15443c9..ed33f25d47 100644
--- a/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
@@ -1,18 +1,16 @@
-
-InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
- • Found type wildcard ‘_a’ standing for ‘b’
- Where: ‘b’ is a rigid type variable bound by
- the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
- at InstantiatedNamedWildcardsInConstraints.hs:4:8
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- foo :: (Enum _a, _) => _a -> (String, b)
- • Relevant bindings include
- foo :: b -> (String, b)
- (bound at InstantiatedNamedWildcardsInConstraints.hs:5:1)
-
-InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
- Found constraint wildcard ‘_’ standing for ‘Show b’
- To use the inferred type, enable PartialTypeSignatures
- In the type signature:
- foo :: (Enum _a, _) => _a -> (String, b)
+
+InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
+ • Found type wildcard ‘_a’ standing for ‘b’
+ Where: ‘b’ is a rigid type variable bound by
+ the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
+ at InstantiatedNamedWildcardsInConstraints.hs:5:1-26
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Enum _a, _) => _a -> (String, b)
+
+InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
+ • Found type wildcard ‘_’ standing for ‘Show b’
+ Where: ‘b’ is a rigid type variable bound by
+ the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
+ at InstantiatedNamedWildcardsInConstraints.hs:5:1-26
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Enum _a, _) => _a -> (String, b)
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
index 5d95186909..0019ec85da 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
@@ -1,11 +1,11 @@
NamedExtraConstraintsWildcard.hs:5:1: error:
- • Could not deduce: t0
- from the context: (Eq a, t)
+ • Could not deduce: w0
+ from the context: (Eq a, w)
bound by the inferred type for ‘foo’:
- (Eq a, t) => a -> a
+ (Eq a, w) => a -> a
at NamedExtraConstraintsWildcard.hs:5:1-15
• In the ambiguity check for the inferred type for ‘foo’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type
- foo :: forall (t :: Constraint) a. (Eq a, t) => a -> a
+ foo :: forall (w :: Constraint) a. (Eq a, w) => a -> a
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr
index 83a9019401..d401382141 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr
@@ -1,52 +1,41 @@
-
-NamedWildcardExplicitForall.hs:8:7: error:
- • Couldn't match type ‘_a’ with ‘Bool’
- ‘_a’ is a rigid type variable bound by
- the type signature for:
- foo :: forall _a. _a -> _a
- at NamedWildcardExplicitForall.hs:7:15
- Expected type: _a -> _a
- Actual type: Bool -> Bool
- • In the expression: not
- In an equation for ‘foo’: foo = not
- • Relevant bindings include
- foo :: _a -> _a (bound at NamedWildcardExplicitForall.hs:8:1)
-
-NamedWildcardExplicitForall.hs:10:8: error:
- • Found type wildcard ‘_a’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- bar :: _a -> _a
- • Relevant bindings include
- bar :: Bool -> Bool (bound at NamedWildcardExplicitForall.hs:11:1)
-
-NamedWildcardExplicitForall.hs:13:26: error:
- • Found type wildcard ‘_b’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- baz :: forall _a. _a -> _b -> (_a, _b)
- • Relevant bindings include
- baz :: _a -> Bool -> (_a, Bool)
- (bound at NamedWildcardExplicitForall.hs:14:1)
-
-NamedWildcardExplicitForall.hs:14:16: error:
- • Couldn't match expected type ‘Bool’ with actual type ‘_a’
- ‘_a’ is a rigid type variable bound by
- the inferred type of baz :: _a -> Bool -> (_a, Bool)
- at NamedWildcardExplicitForall.hs:13:15
- • In the first argument of ‘not’, namely ‘x’
- In the expression: not x
- In the expression: (not x, not y)
- • Relevant bindings include
- x :: _a (bound at NamedWildcardExplicitForall.hs:14:5)
- baz :: _a -> Bool -> (_a, Bool)
- (bound at NamedWildcardExplicitForall.hs:14:1)
-
-NamedWildcardExplicitForall.hs:16:8: error:
- • Found type wildcard ‘_a’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- qux :: _a -> (forall _a. _a -> _a) -> _a
- • Relevant bindings include
- qux :: Bool -> (forall _a. _a -> _a) -> Bool
- (bound at NamedWildcardExplicitForall.hs:17:1)
+
+NamedWildcardExplicitForall.hs:8:7: error:
+ • Couldn't match type ‘_a’ with ‘Bool’
+ ‘_a’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a. _a -> _a
+ at NamedWildcardExplicitForall.hs:7:1-27
+ Expected type: _a -> _a
+ Actual type: Bool -> Bool
+ • In the expression: not
+ In an equation for ‘foo’: foo = not
+ • Relevant bindings include
+ foo :: _a -> _a (bound at NamedWildcardExplicitForall.hs:8:1)
+
+NamedWildcardExplicitForall.hs:10:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _a -> _a
+
+NamedWildcardExplicitForall.hs:13:26: error:
+ • Found type wildcard ‘_b’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: baz :: forall _a. _a -> _b -> (_a, _b)
+
+NamedWildcardExplicitForall.hs:14:16: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘_a’
+ ‘_a’ is a rigid type variable bound by
+ the inferred type of baz :: _a -> Bool -> (_a, Bool)
+ at NamedWildcardExplicitForall.hs:14:1-24
+ • In the first argument of ‘not’, namely ‘x’
+ In the expression: not x
+ In the expression: (not x, not y)
+ • Relevant bindings include
+ x :: _a (bound at NamedWildcardExplicitForall.hs:14:5)
+ baz :: _a -> Bool -> (_a, Bool)
+ (bound at NamedWildcardExplicitForall.hs:14:1)
+
+NamedWildcardExplicitForall.hs:16:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: qux :: _a -> (forall _a. _a -> _a) -> _a
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr
index 805854a1f2..34bf595a7f 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr
@@ -1,16 +1,10 @@
-
-NamedWildcardsEnabled.hs:4:8: error:
- • Found type wildcard ‘_a’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- foo :: _a -> _b
- • Relevant bindings include
- foo :: Bool -> Bool (bound at NamedWildcardsEnabled.hs:5:1)
-
-NamedWildcardsEnabled.hs:4:14: error:
- • Found type wildcard ‘_b’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- foo :: _a -> _b
- • Relevant bindings include
- foo :: Bool -> Bool (bound at NamedWildcardsEnabled.hs:5:1)
+
+NamedWildcardsEnabled.hs:4:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _a -> _b
+
+NamedWildcardsEnabled.hs:4:14: error:
+ • Found type wildcard ‘_b’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _a -> _b
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr
index 46cad28a12..baaaf010d7 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr
@@ -1,24 +1,24 @@
-
-NamedWildcardsNotEnabled.hs:4:9: error:
- • Couldn't match expected type ‘_b’ with actual type ‘Bool’
- ‘_b’ is a rigid type variable bound by
- the type signature for:
- foo :: forall _a _b. _a -> _b
- at NamedWildcardsNotEnabled.hs:3:8
- • In the expression: not x
- In an equation for ‘foo’: foo x = not x
- • Relevant bindings include
- foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
-
-NamedWildcardsNotEnabled.hs:4:13: error:
- • Couldn't match expected type ‘Bool’ with actual type ‘_a’
- ‘_a’ is a rigid type variable bound by
- the type signature for:
- foo :: forall _a _b. _a -> _b
- at NamedWildcardsNotEnabled.hs:3:8
- • In the first argument of ‘not’, namely ‘x’
- In the expression: not x
- In an equation for ‘foo’: foo x = not x
- • Relevant bindings include
- x :: _a (bound at NamedWildcardsNotEnabled.hs:4:5)
- foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
+
+NamedWildcardsNotEnabled.hs:4:9: error:
+ • Couldn't match expected type ‘_b’ with actual type ‘Bool’
+ ‘_b’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a _b. _a -> _b
+ at NamedWildcardsNotEnabled.hs:3:1-15
+ • In the expression: not x
+ In an equation for ‘foo’: foo x = not x
+ • Relevant bindings include
+ foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
+
+NamedWildcardsNotEnabled.hs:4:13: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘_a’
+ ‘_a’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a _b. _a -> _b
+ at NamedWildcardsNotEnabled.hs:3:1-15
+ • In the first argument of ‘not’, namely ‘x’
+ In the expression: not x
+ In an equation for ‘foo’: foo x = not x
+ • Relevant bindings include
+ x :: _a (bound at NamedWildcardsNotEnabled.hs:4:5)
+ foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr
index 244b470e81..20176895eb 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr
@@ -1,12 +1,12 @@
-
-NamedWildcardsNotInMonotype.hs:5:1: error:
- • Could not deduce (Eq t0)
- from the context: (Show a, Eq t, Eq a)
- bound by the inferred type for ‘foo’:
- (Show a, Eq t, Eq a) => a -> a -> String
- at NamedWildcardsNotInMonotype.hs:5:1-33
- The type variable ‘t0’ is ambiguous
- • In the ambiguity check for the inferred type for ‘foo’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- When checking the inferred type
- foo :: forall t a. (Show a, Eq t, Eq a) => a -> a -> String
+
+NamedWildcardsNotInMonotype.hs:5:1: error:
+ • Could not deduce (Eq w0)
+ from the context: (Show a, Eq w, Eq a)
+ bound by the inferred type for ‘foo’:
+ (Show a, Eq w, Eq a) => a -> a -> String
+ at NamedWildcardsNotInMonotype.hs:5:1-33
+ The type variable ‘w0’ is ambiguous
+ • In the ambiguity check for the inferred type for ‘foo’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ foo :: forall w a. (Show a, Eq w, Eq a) => a -> a -> String
diff --git a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr
index 025379a67d..91a8dbe7fd 100644
--- a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr
@@ -1,16 +1,10 @@
-
-PartialTypeSignaturesDisabled.hs:4:8: error:
- • Found type wildcard ‘_’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- foo :: _ -> _
- • Relevant bindings include
- foo :: Bool -> Bool (bound at PartialTypeSignaturesDisabled.hs:5:1)
-
-PartialTypeSignaturesDisabled.hs:4:13: error:
- • Found type wildcard ‘_’ standing for ‘Bool’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- foo :: _ -> _
- • Relevant bindings include
- foo :: Bool -> Bool (bound at PartialTypeSignaturesDisabled.hs:5:1)
+
+PartialTypeSignaturesDisabled.hs:4:8: error:
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _ -> _
+
+PartialTypeSignaturesDisabled.hs:4:13: error:
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _ -> _
diff --git a/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr b/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr
index 436777b2d8..c04cfa2315 100644
--- a/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr
@@ -1,9 +1,9 @@
PatBind3.hs:6:12: error:
- • Couldn't match type ‘(Bool, t)’ with ‘Char’
- Expected type: Maybe ((Bool, t) -> Char)
- Actual type: Maybe ((Bool, t) -> (Bool, t))
+ • Couldn't match type ‘(Bool, w)’ with ‘Char’
+ Expected type: Maybe ((Bool, w) -> Char)
+ Actual type: Maybe ((Bool, w) -> (Bool, w))
• In the expression: Just id
In a pattern binding: Just foo = Just id
• Relevant bindings include
- foo :: (Bool, t) -> Char (bound at PatBind3.hs:6:6)
+ foo :: (Bool, w) -> Char (bound at PatBind3.hs:6:6)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.stderr b/testsuite/tests/partial-sigs/should_fail/T10045.stderr
index d6a3a5ac37..74bfaae357 100644
--- a/testsuite/tests/partial-sigs/should_fail/T10045.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T10045.stderr
@@ -1,25 +1,23 @@
-
-T10045.hs:6:18: error:
- • Found type wildcard ‘_’ standing for ‘t2 -> Bool -> t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10
- ‘t2’ is a rigid type variable bound by
- the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- copy :: _
- In the expression:
- let
- copy :: _
- copy w from = copy w True
- in copy ws1 False
- In an equation for ‘foo’:
- foo (Meta ws1)
- = let
- copy :: _
- copy w from = copy w True
- in copy ws1 False
- • Relevant bindings include
- copy :: t2 -> Bool -> t1 (bound at T10045.hs:7:10)
- ws1 :: () (bound at T10045.hs:5:11)
- foo :: Meta -> t (bound at T10045.hs:5:1)
+
+T10045.hs:6:18: error:
+ • Found type wildcard ‘_’ standing for ‘t2 -> Bool -> t1’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10-34
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10-34
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: copy :: _
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
+ • Relevant bindings include
+ ws1 :: () (bound at T10045.hs:5:11)
+ foo :: Meta -> t (bound at T10045.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10615.stderr b/testsuite/tests/partial-sigs/should_fail/T10615.stderr
index 842b2eb10a..9e46dd20d1 100644
--- a/testsuite/tests/partial-sigs/should_fail/T10615.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T10615.stderr
@@ -1,36 +1,32 @@
-
-T10615.hs:4:7: error:
- • Found type wildcard ‘_’ standing for ‘a1’
- Where: ‘a1’ is an ambiguous type variable
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- f1 :: _ -> f
- • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1)
-
-T10615.hs:5:6: error:
- • Couldn't match type ‘f’ with ‘b1 -> a1’
- ‘f’ is a rigid type variable bound by
- the inferred type of f1 :: a1 -> f at T10615.hs:4:7
- Expected type: a1 -> f
- Actual type: a1 -> b1 -> a1
- • In the expression: const
- In an equation for ‘f1’: f1 = const
- • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1)
-
-T10615.hs:7:7: error:
- • Found type wildcard ‘_’ standing for ‘a0’
- Where: ‘a0’ is an ambiguous type variable
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- f2 :: _ -> _f
- • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1)
-
-T10615.hs:8:6: error:
- • Couldn't match type ‘_f’ with ‘b0 -> a0’
- ‘_f’ is a rigid type variable bound by
- the inferred type of f2 :: a0 -> _f at T10615.hs:7:7
- Expected type: a0 -> _f
- Actual type: a0 -> b0 -> a0
- • In the expression: const
- In an equation for ‘f2’: f2 = const
- • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1)
+
+T10615.hs:4:7: error:
+ • Found type wildcard ‘_’ standing for ‘a1’
+ Where: ‘a1’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f1 :: _ -> f
+
+T10615.hs:5:6: error:
+ • Couldn't match type ‘f’ with ‘b1 -> a1’
+ ‘f’ is a rigid type variable bound by
+ the inferred type of f1 :: a1 -> f at T10615.hs:5:1-10
+ Expected type: a1 -> f
+ Actual type: a1 -> b1 -> a1
+ • In the expression: const
+ In an equation for ‘f1’: f1 = const
+ • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1)
+
+T10615.hs:7:7: error:
+ • Found type wildcard ‘_’ standing for ‘a0’
+ Where: ‘a0’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f2 :: _ -> _f
+
+T10615.hs:8:6: error:
+ • Couldn't match type ‘_f’ with ‘b0 -> a0’
+ ‘_f’ is a rigid type variable bound by
+ the inferred type of f2 :: a0 -> _f at T10615.hs:8:1-10
+ Expected type: a0 -> _f
+ Actual type: a0 -> b0 -> a0
+ • In the expression: const
+ In an equation for ‘f2’: f2 = const
+ • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.stderr b/testsuite/tests/partial-sigs/should_fail/T10999.stderr
index c74719addf..fff2bdeae9 100644
--- a/testsuite/tests/partial-sigs/should_fail/T10999.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T10999.stderr
@@ -1,16 +1,34 @@
-
-T10999.hs:5:6: error:
- Found constraint wildcard ‘_’ standing for ‘Ord a’
- To use the inferred type, enable PartialTypeSignatures
- In the type signature:
- f :: _ => () -> _
-
-T10999.hs:5:17: error:
- • Found type wildcard ‘_’ standing for ‘Set.Set a’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of f :: Ord a => () -> Set.Set a at T10999.hs:6:1
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature:
- f :: _ => () -> _
- • Relevant bindings include
- f :: () -> Set.Set a (bound at T10999.hs:6:1)
+
+T10999.hs:5:6: error:
+ • Found type wildcard ‘_’ standing for ‘Ord a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of f :: Ord a => () -> Set.Set a
+ at T10999.hs:6:1-28
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f :: _ => () -> _
+
+T10999.hs:5:17: error:
+ • Found type wildcard ‘_’ standing for ‘Set.Set a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of f :: Ord a => () -> Set.Set a
+ at T10999.hs:6:1-28
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f :: _ => () -> _
+
+T10999.hs:8:28: error:
+ • Ambiguous type variable ‘b0’ arising from a use of ‘f’
+ prevents the constraint ‘(Ord b0)’ from being solved.
+ Relevant bindings include g :: [b0] (bound at T10999.hs:8:1)
+ Probable fix: use a type annotation to specify what ‘b0’ should be.
+ These potential instances exist:
+ instance Ord a => Ord (Set.Set a)
+ -- Defined in ‘containers-0.5.7.1:Data.Set.Base’
+ instance Ord Ordering -- Defined in ‘GHC.Classes’
+ instance Ord Integer
+ -- Defined in ‘integer-gmp-1.0.0.1:GHC.Integer.Type’
+ ...plus 23 others
+ ...plus two instances involving out-of-scope types
+ (use -fprint-potential-instances to see them all)
+ • In the second argument of ‘($)’, namely ‘f ()’
+ In the second argument of ‘($)’, namely ‘Set.toList $ f ()’
+ In the expression: map fst $ Set.toList $ f ()
diff --git a/testsuite/tests/partial-sigs/should_fail/T11122.stderr b/testsuite/tests/partial-sigs/should_fail/T11122.stderr
index 4a8b75be4a..9216985a58 100644
--- a/testsuite/tests/partial-sigs/should_fail/T11122.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T11122.stderr
@@ -1,7 +1,4 @@
-
-T11122.hs:19:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
- • Found type wildcard ‘_’ standing for ‘Int’
- • In the type signature:
- parser :: Parser _
- • Relevant bindings include
- parser :: Parser Int (bound at T11122.hs:21:1)
+
+T11122.hs:19:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int’
+ • In the type signature: parser :: Parser _
diff --git a/testsuite/tests/partial-sigs/should_fail/T11976.stderr b/testsuite/tests/partial-sigs/should_fail/T11976.stderr
index 06320d9aa9..ac7319891e 100644
--- a/testsuite/tests/partial-sigs/should_fail/T11976.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T11976.stderr
@@ -1,7 +1,7 @@
-
-T11976.hs:7:20: error:
- • Expecting one fewer arguments to ‘Lens t0 t1’
- Expected kind ‘k0 -> *’, but ‘Lens t0 t1’ has kind ‘*’
- • In the type ‘Lens _ _ _’
- In the expression: undefined :: Lens _ _ _
- In an equation for ‘foo’: foo = undefined :: Lens _ _ _
+
+T11976.hs:7:20: error:
+ • Expecting one fewer arguments to ‘Lens w0 w1’
+ Expected kind ‘k0 -> *’, but ‘Lens w0 w1’ has kind ‘*’
+ • In the type ‘Lens _ _ _’
+ In an expression type signature: Lens _ _ _
+ In the expression: undefined :: Lens _ _ _
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr
index 884a4c0bf4..596abe1160 100644
--- a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr
@@ -1,18 +1,16 @@
TidyClash.hs:8:19: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: w_ -> (w_, t1 -> t) at TidyClash.hs:9:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of bar :: w_ -> (w_, w1 -> w)
+ at TidyClash.hs:9:1-28
To use the inferred type, enable PartialTypeSignatures
• In the type signature: bar :: w_ -> (w_, _ -> _)
- • Relevant bindings include
- bar :: w_ -> (w_, t1 -> t) (bound at TidyClash.hs:9:1)
TidyClash.hs:8:24: error:
- • Found type wildcard ‘_’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: w_ -> (w_, t1 -> t) at TidyClash.hs:9:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: w_ -> (w_, w1 -> w)
+ at TidyClash.hs:9:1-28
To use the inferred type, enable PartialTypeSignatures
• In the type signature: bar :: w_ -> (w_, _ -> _)
- • Relevant bindings include
- bar :: w_ -> (w_, t1 -> t) (bound at TidyClash.hs:9:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
index f59ab4d6c9..00c3874a4b 100644
--- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr
@@ -1,57 +1,53 @@
TidyClash2.hs:13:20: error:
- • Found type wildcard ‘_’ standing for ‘t2’
- Where: ‘t2’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In the type signature: barry :: forall t. _ -> _ -> t
- • Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:13:25: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In the type signature: barry :: forall t. _ -> _ -> t
- • Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:13: error:
- • Found type wildcard ‘_’ standing for ‘t2’
- Where: ‘t2’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In a pattern type signature: _
In the pattern: x :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:22: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In a pattern type signature: _
In the pattern: y :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- x :: t2 (bound at TidyClash2.hs:14:8)
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ x :: w1 (bound at TidyClash2.hs:14:8)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:40: error:
- • Found type wildcard ‘_’ standing for ‘t3’
- Where: ‘t3’ is a rigid type variable bound by
- the inferred type of <expression> :: t3 at TidyClash2.hs:14:27
+ • Found type wildcard ‘_’ standing for ‘w2’
+ Where: ‘w2’ is a rigid type variable bound by
+ the inferred type of <expression> :: w2 at TidyClash2.hs:14:40
To use the inferred type, enable PartialTypeSignatures
• In an expression type signature: _
In the expression: undefined :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- y :: t1 (bound at TidyClash2.hs:14:17)
- x :: t2 (bound at TidyClash2.hs:14:8)
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ y :: w (bound at TidyClash2.hs:14:17)
+ x :: w1 (bound at TidyClash2.hs:14:8)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr
index e134fbbcd3..d026cbc70d 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr
@@ -1,58 +1,48 @@
-
-WildcardInstantiations.hs:5:14: error:
- • Found type wildcard ‘_a’ standing for ‘a’
- Where: ‘a’ is a rigid type variable bound by
- the inferred type of foo :: (Show a, Enum a) => a -> String
- at WildcardInstantiations.hs:6:1
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature: foo :: (Show _a, _) => _a -> _
- • Relevant bindings include
- foo :: a -> String (bound at WildcardInstantiations.hs:6:1)
-
-WildcardInstantiations.hs:5:18: error:
- Found constraint wildcard ‘_’ standing for ‘Enum a’
- To use the inferred type, enable PartialTypeSignatures
- In the type signature: foo :: (Show _a, _) => _a -> _
-
-WildcardInstantiations.hs:5:30: error:
- • Found type wildcard ‘_’ standing for ‘String’
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature: foo :: (Show _a, _) => _a -> _
- • Relevant bindings include
- foo :: a -> String (bound at WildcardInstantiations.hs:6:1)
-
-WildcardInstantiations.hs:8:8: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WildcardInstantiations.hs:9:1
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WildcardInstantiations.hs:9:1)
-
-WildcardInstantiations.hs:8:13: error:
- • Found type wildcard ‘_’ standing for ‘t1 -> t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WildcardInstantiations.hs:9:1
- ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WildcardInstantiations.hs:9:1
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WildcardInstantiations.hs:9:1)
-
-WildcardInstantiations.hs:8:18: error:
- • Found type wildcard ‘_’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: t1 -> (t1 -> t) -> t
- at WildcardInstantiations.hs:9:1
- To use the inferred type, enable PartialTypeSignatures
- • In the type signature: bar :: _ -> _ -> _
- • Relevant bindings include
- bar :: t1 -> (t1 -> t) -> t
- (bound at WildcardInstantiations.hs:9:1)
+
+WildcardInstantiations.hs:5:14: error:
+ • Found type wildcard ‘_a’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WildcardInstantiations.hs:6:1-21
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:5:18: error:
+ • Found type wildcard ‘_’ standing for ‘Enum a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WildcardInstantiations.hs:6:1-21
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:5:30: error:
+ • Found type wildcard ‘_’ standing for ‘String’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:8:8: error:
+ • Found type wildcard ‘_’ standing for ‘t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
+
+WildcardInstantiations.hs:8:13: error:
+ • Found type wildcard ‘_’ standing for ‘t -> w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
+
+WildcardInstantiations.hs:8:18: error:
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr
index db14490466..44879c9d4f 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr
@@ -1,74 +1,74 @@
-
-WildcardsInPatternAndExprSig.hs:4:18: error:
- • Found type wildcard ‘_a’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Maybe [t] -> t -> [t]
- at WildcardsInPatternAndExprSig.hs:4:1
- To use the inferred type, enable PartialTypeSignatures
- • In a pattern type signature: _a
- In the pattern: x :: _a
- In the pattern: [x :: _a]
- • Relevant bindings include
- bar :: Maybe [t] -> t -> [t]
- (bound at WildcardsInPatternAndExprSig.hs:4:1)
-
-WildcardsInPatternAndExprSig.hs:4:25: error:
- • Found type wildcard ‘_’ standing for ‘[t]’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Maybe [t] -> t -> [t]
- at WildcardsInPatternAndExprSig.hs:4:1
- To use the inferred type, enable PartialTypeSignatures
- • In a pattern type signature: _
- In the pattern: [x :: _a] :: _
- In the pattern: Just ([x :: _a] :: _)
- • Relevant bindings include
- bar :: Maybe [t] -> t -> [t]
- (bound at WildcardsInPatternAndExprSig.hs:4:1)
-
-WildcardsInPatternAndExprSig.hs:4:38: error:
- • Found type wildcard ‘_b’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Maybe [t] -> t -> [t]
- at WildcardsInPatternAndExprSig.hs:4:1
- To use the inferred type, enable PartialTypeSignatures
- • In a pattern type signature: Maybe [_b]
- In the pattern: Just ([x :: _a] :: _) :: Maybe [_b]
- In an equation for ‘bar’:
- bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
- = [x, z] :: [_d]
- • Relevant bindings include
- bar :: Maybe [t] -> t -> [t]
- (bound at WildcardsInPatternAndExprSig.hs:4:1)
-
-WildcardsInPatternAndExprSig.hs:4:49: error:
- • Found type wildcard ‘_c’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Maybe [t] -> t -> [t]
- at WildcardsInPatternAndExprSig.hs:4:1
- To use the inferred type, enable PartialTypeSignatures
- • In a pattern type signature: _c
- In the pattern: z :: _c
- In an equation for ‘bar’:
- bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
- = [x, z] :: [_d]
- • Relevant bindings include
- x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
- bar :: Maybe [t] -> t -> [t]
- (bound at WildcardsInPatternAndExprSig.hs:4:1)
-
-WildcardsInPatternAndExprSig.hs:4:66: error:
- • Found type wildcard ‘_d’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: Maybe [t] -> t -> [t]
- at WildcardsInPatternAndExprSig.hs:4:1
- To use the inferred type, enable PartialTypeSignatures
- • In an expression type signature: [_d]
- In the expression: [x, z] :: [_d]
- In an equation for ‘bar’:
- bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
- = [x, z] :: [_d]
- • Relevant bindings include
- z :: t (bound at WildcardsInPatternAndExprSig.hs:4:44)
- x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
- bar :: Maybe [t] -> t -> [t]
- (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:18: error:
+ • Found type wildcard ‘_a’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _a
+ In the pattern: x :: _a
+ In the pattern: [x :: _a]
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:25: error:
+ • Found type wildcard ‘_’ standing for ‘[w]’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _
+ In the pattern: [x :: _a] :: _
+ In the pattern: Just ([x :: _a] :: _)
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:38: error:
+ • Found type wildcard ‘_b’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: Maybe [_b]
+ In the pattern: Just ([x :: _a] :: _) :: Maybe [_b]
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:49: error:
+ • Found type wildcard ‘_c’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _c
+ In the pattern: z :: _c
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ x :: w (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:66: error:
+ • Found type wildcard ‘_d’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In an expression type signature: [_d]
+ In the expression: [x, z] :: [_d]
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ z :: w (bound at WildcardsInPatternAndExprSig.hs:4:44)
+ x :: w (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T
index 67d59a5ced..e8f5928c45 100644
--- a/testsuite/tests/partial-sigs/should_fail/all.T
+++ b/testsuite/tests/partial-sigs/should_fail/all.T
@@ -1,7 +1,7 @@
test('AnnotatedConstraint', normal, compile_fail, [''])
test('AnnotatedConstraintNotForgotten', normal, compile_fail, [''])
test('Defaulting1MROff', normal, compile, [''])
-test('ExtraConstraintsWildcardInExpressionSignature', normal, compile_fail, [''])
+test('ExtraConstraintsWildcardInExpressionSignature', normal, compile, [''])
test('ExtraConstraintsWildcardInPatternSignature', normal, compile_fail, [''])
test('ExtraConstraintsWildcardInPatternSplice', normal, compile_fail, [''])
test('ExtraConstraintsWildcardInTypeSpliceUsed',
@@ -62,3 +62,4 @@ test('T11122', normal, compile, [''])
test('T11976', normal, compile_fail, [''])
test('PatBind3', normal, compile_fail, [''])
test('T12039', normal, compile_fail, [''])
+
diff --git a/testsuite/tests/patsyn/should_fail/T11010.stderr b/testsuite/tests/patsyn/should_fail/T11010.stderr
index 47492cde3a..1bd83c83b4 100644
--- a/testsuite/tests/patsyn/should_fail/T11010.stderr
+++ b/testsuite/tests/patsyn/should_fail/T11010.stderr
@@ -1,14 +1,14 @@
-
-T11010.hs:9:36: error:
- • Couldn't match type ‘a1’ with ‘Int’
- ‘a1’ is a rigid type variable bound by
- a pattern with constructor:
- Fun :: forall b a. String -> (a -> b) -> Expr a -> Expr b,
- in a pattern synonym declaration
- at T11010.hs:9:26
- Expected type: a -> b
- Actual type: a1 -> b
- • In the declaration for pattern synonym ‘IntFun’
- • Relevant bindings include
- x :: Expr a1 (bound at T11010.hs:9:36)
- f :: a1 -> b (bound at T11010.hs:9:34)
+
+T11010.hs:9:36: error:
+ • Couldn't match type ‘a1’ with ‘Int’
+ ‘a1’ is a rigid type variable bound by
+ a pattern with constructor:
+ Fun :: forall b a. String -> (a -> b) -> Expr a -> Expr b,
+ in a pattern synonym declaration
+ at T11010.hs:9:26-36
+ Expected type: a -> b
+ Actual type: a1 -> b
+ • In the declaration for pattern synonym ‘IntFun’
+ • Relevant bindings include
+ x :: Expr a1 (bound at T11010.hs:9:36)
+ f :: a1 -> b (bound at T11010.hs:9:34)
diff --git a/testsuite/tests/patsyn/should_fail/T11039.stderr b/testsuite/tests/patsyn/should_fail/T11039.stderr
index 9b749d1758..15a56e01ac 100644
--- a/testsuite/tests/patsyn/should_fail/T11039.stderr
+++ b/testsuite/tests/patsyn/should_fail/T11039.stderr
@@ -1,9 +1,9 @@
-
-T11039.hs:8:15: error:
- • Couldn't match type ‘f’ with ‘A’
- ‘f’ is a rigid type variable bound by
- the signature for pattern synonym ‘Q’ at T11039.hs:7:14
- Expected type: f a
- Actual type: A a
- • In the pattern: A a
- In the declaration for pattern synonym ‘Q’
+
+T11039.hs:8:15: error:
+ • Couldn't match type ‘f’ with ‘A’
+ ‘f’ is a rigid type variable bound by
+ the signature for pattern synonym ‘Q’ at T11039.hs:7:14-38
+ Expected type: f a
+ Actual type: A a
+ • In the pattern: A a
+ In the declaration for pattern synonym ‘Q’
diff --git a/testsuite/tests/patsyn/should_fail/T11667.stderr b/testsuite/tests/patsyn/should_fail/T11667.stderr
index 44bf88ced9..0407d00d09 100644
--- a/testsuite/tests/patsyn/should_fail/T11667.stderr
+++ b/testsuite/tests/patsyn/should_fail/T11667.stderr
@@ -1,41 +1,41 @@
-
-T11667.hs:12:22: error:
- • Could not deduce (Num a) arising from the literal ‘42’
- from the context: Eq a
- bound by the signature for pattern synonym ‘Pat1’
- at T11667.hs:12:9-12
- Possible fix:
- add (Num a) to the "required" context of
- the signature for pattern synonym ‘Pat1’
- • In the pattern: 42
- In the pattern: Just 42
- In the declaration for pattern synonym ‘Pat1’
-
-T11667.hs:18:28: error:
- • Couldn't match type ‘b’ with ‘Bool’
- arising from the "provided" constraints claimed by
- the signature of ‘Pat2’
- ‘b’ is a rigid type variable bound by
- the signature for pattern synonym ‘Pat2’ at T11667.hs:17:17
- • In the declaration for pattern synonym ‘Pat2’
- • Relevant bindings include y :: b (bound at T11667.hs:18:21)
-
-T11667.hs:24:24: error:
- • No instance for (Show a)
- arising from the "provided" constraints claimed by
- the signature of ‘Pat3’
- In other words, a successful match on the pattern
- Just x
- does not provide the constraint (Show a)
- • In the declaration for pattern synonym ‘Pat3’
-
-T11667.hs:31:16: error:
- • Could not deduce (Num a) arising from a use of ‘MkS’
- from the context: (Eq a, Show a)
- bound by the signature for pattern synonym ‘Pat4’
- at T11667.hs:31:1-21
- Possible fix:
- add (Num a) to the "required" context of
- the signature for pattern synonym ‘Pat4’
- • In the expression: MkS 42
- In an equation for ‘Pat4’: Pat4 = MkS 42
+
+T11667.hs:12:22: error:
+ • Could not deduce (Num a) arising from the literal ‘42’
+ from the context: Eq a
+ bound by the signature for pattern synonym ‘Pat1’
+ at T11667.hs:12:9-12
+ Possible fix:
+ add (Num a) to the "required" context of
+ the signature for pattern synonym ‘Pat1’
+ • In the pattern: 42
+ In the pattern: Just 42
+ In the declaration for pattern synonym ‘Pat1’
+
+T11667.hs:18:28: error:
+ • Couldn't match type ‘b’ with ‘Bool’
+ arising from the "provided" constraints claimed by
+ the signature of ‘Pat2’
+ ‘b’ is a rigid type variable bound by
+ the signature for pattern synonym ‘Pat2’ at T11667.hs:17:17-50
+ • In the declaration for pattern synonym ‘Pat2’
+ • Relevant bindings include y :: b (bound at T11667.hs:18:21)
+
+T11667.hs:24:24: error:
+ • No instance for (Show a)
+ arising from the "provided" constraints claimed by
+ the signature of ‘Pat3’
+ In other words, a successful match on the pattern
+ Just x
+ does not provide the constraint (Show a)
+ • In the declaration for pattern synonym ‘Pat3’
+
+T11667.hs:31:16: error:
+ • Could not deduce (Num a) arising from a use of ‘MkS’
+ from the context: (Eq a, Show a)
+ bound by the signature for pattern synonym ‘Pat4’
+ at T11667.hs:31:1-21
+ Possible fix:
+ add (Num a) to the "required" context of
+ the signature for pattern synonym ‘Pat4’
+ • In the expression: MkS 42
+ In an equation for ‘Pat4’: Pat4 = MkS 42
diff --git a/testsuite/tests/polykinds/T10503.stderr b/testsuite/tests/polykinds/T10503.stderr
index a74615cd06..8bfdc6bd6d 100644
--- a/testsuite/tests/polykinds/T10503.stderr
+++ b/testsuite/tests/polykinds/T10503.stderr
@@ -1,16 +1,16 @@
-
-T10503.hs:8:6: error:
- • Could not deduce: k ~ *
- from the context: Proxy 'KProxy ~ Proxy 'KProxy
- bound by the type signature for:
- h :: Proxy 'KProxy ~ Proxy 'KProxy => r
- at T10503.hs:8:6-85
- ‘k’ is a rigid type variable bound by
- the type signature for:
- h :: forall k r. (Proxy 'KProxy ~ Proxy 'KProxy => r) -> r
- at T10503.hs:8:6
- • In the ambiguity check for ‘h’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- h :: forall r.
- (Proxy (KProxy :: KProxy k) ~ Proxy (KProxy :: KProxy *) => r) -> r
+
+T10503.hs:8:6: error:
+ • Could not deduce: k ~ *
+ from the context: Proxy 'KProxy ~ Proxy 'KProxy
+ bound by the type signature for:
+ h :: Proxy 'KProxy ~ Proxy 'KProxy => r
+ at T10503.hs:8:6-85
+ ‘k’ is a rigid type variable bound by
+ the type signature for:
+ h :: forall k r. (Proxy 'KProxy ~ Proxy 'KProxy => r) -> r
+ at T10503.hs:8:6-85
+ • In the ambiguity check for ‘h’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature:
+ h :: forall r.
+ (Proxy (KProxy :: KProxy k) ~ Proxy (KProxy :: KProxy *) => r) -> r
diff --git a/testsuite/tests/polykinds/T11399.hs b/testsuite/tests/polykinds/T11399.hs
index 56f1faa682..bc9e60d7f3 100644
--- a/testsuite/tests/polykinds/T11399.hs
+++ b/testsuite/tests/polykinds/T11399.hs
@@ -4,4 +4,7 @@ module T11399 where
import Data.Kind
newtype UhOh (k :: * -> *) (a :: k *) = UhOh (k *)
-instance Functor k => Functor (UhOh k) where
+
+-- UhOh :: forall (k : * -> *). k * -> *
+
+instance Functor a => Functor (UhOh a) where
diff --git a/testsuite/tests/polykinds/T11399.stderr b/testsuite/tests/polykinds/T11399.stderr
index 5e09870088..4af1c57b75 100644
--- a/testsuite/tests/polykinds/T11399.stderr
+++ b/testsuite/tests/polykinds/T11399.stderr
@@ -1,9 +1,9 @@
-
-T11399.hs:7:32: error:
- • Couldn't match kind ‘*’ with ‘GHC.Types.RuntimeRep’
- When matching kinds
- k :: * -> *
- TYPE :: GHC.Types.RuntimeRep -> *
- Expected kind ‘* -> *’, but ‘UhOh k’ has kind ‘k * -> *’
- • In the first argument of ‘Functor’, namely ‘UhOh k’
- In the instance declaration for ‘Functor (UhOh k)’
+
+T11399.hs:10:32: error:
+ • Couldn't match kind ‘*’ with ‘GHC.Types.RuntimeRep’
+ When matching kinds
+ a :: * -> *
+ TYPE :: GHC.Types.RuntimeRep -> *
+ Expected kind ‘* -> *’, but ‘UhOh a’ has kind ‘a * -> *’
+ • In the first argument of ‘Functor’, namely ‘UhOh a’
+ In the instance declaration for ‘Functor (UhOh a)’
diff --git a/testsuite/tests/polykinds/T7438.stderr b/testsuite/tests/polykinds/T7438.stderr
index 12d93fcf0f..31ac2a356e 100644
--- a/testsuite/tests/polykinds/T7438.stderr
+++ b/testsuite/tests/polykinds/T7438.stderr
@@ -1,19 +1,21 @@
-
-T7438.hs:6:14: error:
- • Couldn't match expected type ‘t2’ with actual type ‘t3’
- ‘t2’ is untouchable
- inside the constraints: t ~ t1
- bound by a pattern with constructor:
- Nil :: forall k (a :: k). Thrist a a,
- in an equation for ‘go’
- at T7438.hs:6:4-6
- ‘t2’ is a rigid type variable bound by
- the inferred type of go :: Thrist t1 t -> t3 -> t2 at T7438.hs:6:1
- ‘t3’ is a rigid type variable bound by
- the inferred type of go :: Thrist t1 t -> t3 -> t2 at T7438.hs:6:1
- Possible fix: add a type signature for ‘go’
- • In the expression: acc
- In an equation for ‘go’: go Nil acc = acc
- • Relevant bindings include
- acc :: t3 (bound at T7438.hs:6:8)
- go :: Thrist t1 t -> t3 -> t2 (bound at T7438.hs:6:1)
+
+T7438.hs:6:14: error:
+ • Couldn't match expected type ‘t2’ with actual type ‘t3’
+ ‘t2’ is untouchable
+ inside the constraints: t ~ t1
+ bound by a pattern with constructor:
+ Nil :: forall k (a :: k). Thrist a a,
+ in an equation for ‘go’
+ at T7438.hs:6:4-6
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of go :: Thrist t1 t -> t3 -> t2
+ at T7438.hs:6:1-16
+ ‘t3’ is a rigid type variable bound by
+ the inferred type of go :: Thrist t1 t -> t3 -> t2
+ at T7438.hs:6:1-16
+ Possible fix: add a type signature for ‘go’
+ • In the expression: acc
+ In an equation for ‘go’: go Nil acc = acc
+ • Relevant bindings include
+ acc :: t3 (bound at T7438.hs:6:8)
+ go :: Thrist t1 t -> t3 -> t2 (bound at T7438.hs:6:1)
diff --git a/testsuite/tests/polykinds/T7594.stderr b/testsuite/tests/polykinds/T7594.stderr
index be2acfebe0..f3d42af8a0 100644
--- a/testsuite/tests/polykinds/T7594.stderr
+++ b/testsuite/tests/polykinds/T7594.stderr
@@ -1,17 +1,17 @@
-
-T7594.hs:35:12: error:
- • Couldn't match type ‘b’ with ‘IO ()’
- ‘b’ is untouchable
- inside the constraints: (:&:) c0 Real a
- bound by a type expected by the context:
- (:&:) c0 Real a => a -> b
- at T7594.hs:35:8-19
- ‘b’ is a rigid type variable bound by
- the inferred type of bar2 :: b at T7594.hs:35:1
- Possible fix: add a type signature for ‘bar2’
- Expected type: a -> b
- Actual type: a -> IO ()
- • In the first argument of ‘app’, namely ‘print’
- In the expression: app print q2
- In an equation for ‘bar2’: bar2 = app print q2
- • Relevant bindings include bar2 :: b (bound at T7594.hs:35:1)
+
+T7594.hs:35:12: error:
+ • Couldn't match type ‘b’ with ‘IO ()’
+ ‘b’ is untouchable
+ inside the constraints: (:&:) c0 Real a
+ bound by a type expected by the context:
+ (:&:) c0 Real a => a -> b
+ at T7594.hs:35:8-19
+ ‘b’ is a rigid type variable bound by
+ the inferred type of bar2 :: b at T7594.hs:35:1-19
+ Possible fix: add a type signature for ‘bar2’
+ Expected type: a -> b
+ Actual type: a -> IO ()
+ • In the first argument of ‘app’, namely ‘print’
+ In the expression: app print q2
+ In an equation for ‘bar2’: bar2 = app print q2
+ • Relevant bindings include bar2 :: b (bound at T7594.hs:35:1)
diff --git a/testsuite/tests/polykinds/T9017.stderr b/testsuite/tests/polykinds/T9017.stderr
index b52000e7a1..3e7f60e9b1 100644
--- a/testsuite/tests/polykinds/T9017.stderr
+++ b/testsuite/tests/polykinds/T9017.stderr
@@ -1,13 +1,13 @@
-
-T9017.hs:8:7: error:
- • Couldn't match kind ‘k1’ with ‘*’
- ‘k1’ is a rigid type variable bound by
- the type signature for:
- foo :: forall k k1 (a :: k1 -> k -> *) (b :: k1) (m :: k1 -> k).
- a b (m b)
- at T9017.hs:7:8
- When matching the kind of ‘a’
- • In the expression: arr return
- In an equation for ‘foo’: foo = arr return
- • Relevant bindings include
- foo :: a b (m b) (bound at T9017.hs:8:1)
+
+T9017.hs:8:7: error:
+ • Couldn't match kind ‘k1’ with ‘*’
+ ‘k1’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall k k1 (a :: k1 -> k -> *) (b :: k1) (m :: k1 -> k).
+ a b (m b)
+ at T9017.hs:7:1-16
+ When matching the kind of ‘a’
+ • In the expression: arr return
+ In an equation for ‘foo’: foo = arr return
+ • Relevant bindings include
+ foo :: a b (m b) (bound at T9017.hs:8:1)
diff --git a/testsuite/tests/rename/should_fail/rnfail026.stderr b/testsuite/tests/rename/should_fail/rnfail026.stderr
index 63a1a2130d..6c032b0487 100644
--- a/testsuite/tests/rename/should_fail/rnfail026.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail026.stderr
@@ -1,10 +1,11 @@
-
-rnfail026.hs:16:27: error:
- • Expected kind ‘* -> *’, but ‘Set a’ has kind ‘*’
- • In the first argument of ‘Monad’, namely
- ‘forall a. Eq a => Set a’
- In the instance declaration for ‘Monad (forall a. Eq a => Set a)’
-
-rnfail026.hs:19:10: error:
- • Illegal polymorphic type: forall a. [a]
- • In the instance declaration for ‘Eq (forall a. [a])’
+
+rnfail026.hs:16:27: error:
+ • Expecting one fewer arguments to ‘Set a’
+ Expected kind ‘* -> *’, but ‘Set a’ has kind ‘*’
+ • In the first argument of ‘Monad’, namely
+ ‘forall a. Eq a => Set a’
+ In the instance declaration for ‘Monad (forall a. Eq a => Set a)’
+
+rnfail026.hs:19:10: error:
+ • Illegal polymorphic type: forall a. [a]
+ • In the instance declaration for ‘Eq (forall a. [a])’
diff --git a/testsuite/tests/th/T10267.stderr b/testsuite/tests/th/T10267.stderr
index 0a86955e1a..171c9e8f3a 100644
--- a/testsuite/tests/th/T10267.stderr
+++ b/testsuite/tests/th/T10267.stderr
@@ -1,46 +1,46 @@
-
-T10267.hs:8:1: error:
- • Found hole: _ :: a0
- Where: ‘a0’ is a rigid type variable bound by
- the type signature for:
- j :: forall a0. a0 -> a0
- at T10267.hs:8:1
- • In the expression: _
- In an equation for ‘j’: j x = _
- • Relevant bindings include
- x :: a0 (bound at T10267.hs:8:1)
- j :: a0 -> a0 (bound at T10267.hs:8:1)
-
-T10267.hs:8:1: error:
- • Found hole: _foo :: a0 -> a0
- Where: ‘a0’ is a rigid type variable bound by
- the type signature for:
- i :: forall a0. a0 -> a0
- at T10267.hs:8:1
- Or perhaps ‘_foo’ is mis-spelled, or not in scope
- • In the expression: _foo
- In an equation for ‘i’: i = _foo
- • Relevant bindings include i :: a0 -> a0 (bound at T10267.hs:8:1)
-
-T10267.hs:14:3: error:
- • Found hole: _foo :: a -> a
- Where: ‘a’ is a rigid type variable bound by
- the type signature for:
- k :: forall a. a -> a
- at T10267.hs:14:3
- Or perhaps ‘_foo’ is mis-spelled, or not in scope
- • In the expression: _foo
- In an equation for ‘k’: k = _foo
- • Relevant bindings include k :: a -> a (bound at T10267.hs:14:3)
-
-T10267.hs:23:3: error:
- • Found hole: _ :: a
- Where: ‘a’ is a rigid type variable bound by
- the type signature for:
- l :: forall a. a -> a
- at T10267.hs:23:3
- • In the expression: _
- In an equation for ‘l’: l x = _
- • Relevant bindings include
- x :: a (bound at T10267.hs:23:3)
- l :: a -> a (bound at T10267.hs:23:3)
+
+T10267.hs:8:1: error:
+ • Found hole: _ :: a
+ Where: ‘a’ is a rigid type variable bound by
+ the type signature for:
+ j :: forall a. a -> a
+ at T10267.hs:(8,1)-(12,14)
+ • In the expression: _
+ In an equation for ‘j’: j x = _
+ • Relevant bindings include
+ x :: a (bound at T10267.hs:8:1)
+ j :: a -> a (bound at T10267.hs:8:1)
+
+T10267.hs:8:1: error:
+ • Found hole: _foo :: a -> a
+ Where: ‘a’ is a rigid type variable bound by
+ the type signature for:
+ i :: forall a. a -> a
+ at T10267.hs:(8,1)-(12,14)
+ Or perhaps ‘_foo’ is mis-spelled, or not in scope
+ • In the expression: _foo
+ In an equation for ‘i’: i = _foo
+ • Relevant bindings include i :: a -> a (bound at T10267.hs:8:1)
+
+T10267.hs:14:3: error:
+ • Found hole: _foo :: a -> a
+ Where: ‘a’ is a rigid type variable bound by
+ the type signature for:
+ k :: forall a. a -> a
+ at T10267.hs:(14,3)-(21,2)
+ Or perhaps ‘_foo’ is mis-spelled, or not in scope
+ • In the expression: _foo
+ In an equation for ‘k’: k = _foo
+ • Relevant bindings include k :: a -> a (bound at T10267.hs:14:3)
+
+T10267.hs:23:3: error:
+ • Found hole: _ :: a
+ Where: ‘a’ is a rigid type variable bound by
+ the type signature for:
+ l :: forall a. a -> a
+ at T10267.hs:(23,3)-(30,2)
+ • In the expression: _
+ In an equation for ‘l’: l x = _
+ • Relevant bindings include
+ x :: a (bound at T10267.hs:23:3)
+ l :: a -> a (bound at T10267.hs:23:3)
diff --git a/testsuite/tests/typecheck/should_compile/ExPat.hs b/testsuite/tests/typecheck/should_compile/ExPat.hs
new file mode 100644
index 0000000000..a0b4b0b007
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/ExPat.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE ViewPatterns, GADTs #-}
+
+module ExPat where
+
+data T where
+ MkT :: Integral a => a -> Int -> T
+
+-- c.f. T11700
+
+-- Succeeds becuase y::Int
+f x = let MkT _ y = x
+ in y
+
+-- Remarkablly, this succeeds because
+-- (toInteger (v::a)) is an Integer
+g x = let MkT (toInteger -> y) _ = x
+ in y
diff --git a/testsuite/tests/typecheck/should_compile/ExPatFail.hs b/testsuite/tests/typecheck/should_compile/ExPatFail.hs
new file mode 100644
index 0000000000..1a25adf388
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/ExPatFail.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE GADTs #-}
+
+module ExPatFail where
+
+data T where
+ MkT :: Integral a => a -> Int -> T
+
+-- Fails becuase y is bound to an existential type
+-- Mind you, the error message is pretty terrible
+-- c.f. T11700
+
+f x = let MkT y _ = x
+ in y
diff --git a/testsuite/tests/typecheck/should_compile/ExPatFail.stderr b/testsuite/tests/typecheck/should_compile/ExPatFail.stderr
new file mode 100644
index 0000000000..afae403614
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/ExPatFail.stderr
@@ -0,0 +1,14 @@
+
+ExPatFail.hs:12:15: error:
+ • Couldn't match expected type ‘t’ with actual type ‘a’
+ because type variable ‘a’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ a pattern with constructor:
+ MkT :: forall a. Integral a => a -> Int -> T,
+ in a pattern binding
+ at ExPatFail.hs:12:11-17
+ • In the pattern: MkT y _
+ In a pattern binding: MkT y _ = x
+ In the expression: let MkT y _ = x in y
+ • Relevant bindings include
+ f :: T -> t (bound at ExPatFail.hs:12:1)
diff --git a/testsuite/tests/typecheck/should_compile/FD1.stderr b/testsuite/tests/typecheck/should_compile/FD1.stderr
index 395217af8b..9223b8e946 100644
--- a/testsuite/tests/typecheck/should_compile/FD1.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD1.stderr
@@ -1,10 +1,10 @@
-
-FD1.hs:16:1: error:
- • Couldn't match expected type ‘a’ with actual type ‘Int -> Int’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- plus :: forall a. E a (Int -> Int) => Int -> a
- at FD1.hs:15:9
- • The equation(s) for ‘plus’ have two arguments,
- but its type ‘Int -> a’ has only one
- • Relevant bindings include plus :: Int -> a (bound at FD1.hs:16:1)
+
+FD1.hs:16:1: error:
+ • Couldn't match expected type ‘a’ with actual type ‘Int -> Int’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ plus :: forall a. E a (Int -> Int) => Int -> a
+ at FD1.hs:15:1-38
+ • The equation(s) for ‘plus’ have two arguments,
+ but its type ‘Int -> a’ has only one
+ • Relevant bindings include plus :: Int -> a (bound at FD1.hs:16:1)
diff --git a/testsuite/tests/typecheck/should_compile/FD2.stderr b/testsuite/tests/typecheck/should_compile/FD2.stderr
index ff3a923988..98de9d7f49 100644
--- a/testsuite/tests/typecheck/should_compile/FD2.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD2.stderr
@@ -1,20 +1,20 @@
-
-FD2.hs:26:36: error:
- • Couldn't match expected type ‘e’ with actual type ‘e1’
- ‘e1’ is a rigid type variable bound by
- the type signature for:
- mf :: forall e1. Elem a e1 => e1 -> Maybe e1 -> Maybe e1
- at FD2.hs:24:18
- ‘e’ is a rigid type variable bound by
- the type signature for:
- foldr1 :: forall e. Elem a e => (e -> e -> e) -> a -> e
- at FD2.hs:21:13
- • In the first argument of ‘f’, namely ‘x’
- In the first argument of ‘Just’, namely ‘(f x y)’
- In the expression: Just (f x y)
- • Relevant bindings include
- y :: e1 (bound at FD2.hs:26:23)
- x :: e1 (bound at FD2.hs:26:15)
- mf :: e1 -> Maybe e1 -> Maybe e1 (bound at FD2.hs:25:12)
- f :: e -> e -> e (bound at FD2.hs:22:10)
- foldr1 :: (e -> e -> e) -> a -> e (bound at FD2.hs:22:3)
+
+FD2.hs:26:36: error:
+ • Couldn't match expected type ‘e’ with actual type ‘e1’
+ ‘e1’ is a rigid type variable bound by
+ the type signature for:
+ mf :: forall e1. Elem a e1 => e1 -> Maybe e1 -> Maybe e1
+ at FD2.hs:24:12-54
+ ‘e’ is a rigid type variable bound by
+ the type signature for:
+ foldr1 :: forall e. Elem a e => (e -> e -> e) -> a -> e
+ at FD2.hs:21:13-47
+ • In the first argument of ‘f’, namely ‘x’
+ In the first argument of ‘Just’, namely ‘(f x y)’
+ In the expression: Just (f x y)
+ • Relevant bindings include
+ y :: e1 (bound at FD2.hs:26:23)
+ x :: e1 (bound at FD2.hs:26:15)
+ mf :: e1 -> Maybe e1 -> Maybe e1 (bound at FD2.hs:25:12)
+ f :: e -> e -> e (bound at FD2.hs:22:10)
+ foldr1 :: (e -> e -> e) -> a -> e (bound at FD2.hs:22:3)
diff --git a/testsuite/tests/typecheck/should_compile/FD3.stderr b/testsuite/tests/typecheck/should_compile/FD3.stderr
index f0dafbe47c..19f819f239 100644
--- a/testsuite/tests/typecheck/should_compile/FD3.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD3.stderr
@@ -1,15 +1,15 @@
-
-FD3.hs:15:15: error:
- • Couldn't match type ‘a’ with ‘(String, a)’
- arising from a functional dependency between:
- constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’
- instance ‘MkA a1 a1’ at FD3.hs:12:10-16
- ‘a’ is a rigid type variable bound by
- the type signature for:
- translate :: forall a. (String, a) -> A a
- at FD3.hs:14:14
- • In the expression: mkA a
- In an equation for ‘translate’: translate a = mkA a
- • Relevant bindings include
- a :: (String, a) (bound at FD3.hs:15:11)
- translate :: (String, a) -> A a (bound at FD3.hs:15:1)
+
+FD3.hs:15:15: error:
+ • Couldn't match type ‘a’ with ‘(String, a)’
+ arising from a functional dependency between:
+ constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’
+ instance ‘MkA a1 a1’ at FD3.hs:12:10-16
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ translate :: forall a. (String, a) -> A a
+ at FD3.hs:14:1-31
+ • In the expression: mkA a
+ In an equation for ‘translate’: translate a = mkA a
+ • Relevant bindings include
+ a :: (String, a) (bound at FD3.hs:15:11)
+ translate :: (String, a) -> A a (bound at FD3.hs:15:1)
diff --git a/testsuite/tests/typecheck/should_compile/SigTyVars.hs b/testsuite/tests/typecheck/should_compile/SigTyVars.hs
new file mode 100644
index 0000000000..7950ae7d45
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/SigTyVars.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module SigTyVars where
+
+-- Here the lexically scoped type variables 'a' and 'b'
+-- both map to the same skolem 'x'. It's perhaps a bit
+-- surprising, but it's awkward to prevent, and it seems
+-- easier to leave it.
+
+f :: x -> x -> [x]
+f (x::a) (y::b) = [x::b, y::a]
+
diff --git a/testsuite/tests/typecheck/should_compile/T10072.stderr b/testsuite/tests/typecheck/should_compile/T10072.stderr
index eb14ad8de5..768658133c 100644
--- a/testsuite/tests/typecheck/should_compile/T10072.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10072.stderr
@@ -1,8 +1,8 @@
-
-T10072.hs:3:31: error:
- • Found type wildcard ‘_’ standing for ‘b’
- Where: ‘b’ is a rigid type variable bound by
- the RULE "map/empty" at T10072.hs:3:1
- To use the inferred type, enable PartialTypeSignatures
- • In a RULE for ‘f’: a -> _
- When checking the transformation rule "map/empty"
+
+T10072.hs:3:31: error:
+ • Found type wildcard ‘_’ standing for ‘b’
+ Where: ‘b’ is a rigid type variable bound by
+ the RULE "map/empty" at T10072.hs:3:1-47
+ To use the inferred type, enable PartialTypeSignatures
+ • In a RULE for ‘f’: a -> _
+ When checking the transformation rule "map/empty"
diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr
index c3d112f6bf..45fd33c7f4 100644
--- a/testsuite/tests/typecheck/should_compile/T10632.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10632.stderr
@@ -1,5 +1,5 @@
-
-T10632.hs:3:1: warning: [-Wredundant-constraints (in -Wall)]
- • Redundant constraint: ?file1::String
- • In the type signature for:
- f :: (?file1::String) => IO ()
+
+T10632.hs:3:1: warning: [-Wredundant-constraints (in -Wall)]
+ • Redundant constraint: ?file1::String
+ • In the type signature for:
+ f :: (?file1::String) => IO ()
diff --git a/testsuite/tests/typecheck/should_compile/T11339.hs b/testsuite/tests/typecheck/should_compile/T11339.hs
new file mode 100644
index 0000000000..9f108083f8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11339.hs
@@ -0,0 +1,32 @@
+{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
+
+module T11339 where
+
+import Control.Applicative ( Const(Const, getConst) )
+import Data.Functor.Identity ( Identity(Identity) )
+
+type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
+
+failing :: forall s t a b . Traversal s t a b -> Traversal s t a b -> Traversal s t a b
+failing left right afb s = case pins t of
+ [] -> right afb s
+ _ -> t afb
+ where
+ t :: Applicative f => (a -> f b) -> f t
+ -- Does not work because the MR applies to this binding group
+ Bazaar { getBazaar = t } = left sell s
+
+ sell :: a -> Bazaar a b b
+ sell w = Bazaar ($ w)
+
+ pins :: ((a -> Const [Identity a] b) -> Const [Identity a] t) -> [Identity a]
+ pins f = getConst (f (\ra -> Const [Identity ra]))
+
+newtype Bazaar a b t = Bazaar { getBazaar :: (forall f. Applicative f => (a -> f b) -> f t) }
+
+instance Functor (Bazaar a b) where
+ fmap f (Bazaar k) = Bazaar (fmap f . k)
+
+instance Applicative (Bazaar a b) where
+ pure a = Bazaar $ \_ -> pure a
+ Bazaar mf <*> Bazaar ma = Bazaar $ \afb -> mf afb <*> ma afb
diff --git a/testsuite/tests/typecheck/should_compile/T11339.stderr b/testsuite/tests/typecheck/should_compile/T11339.stderr
new file mode 100644
index 0000000000..9e8a8eca53
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11339.stderr
@@ -0,0 +1,15 @@
+
+T11339.hs:15:5: error:
+ • Illegal overloaded signature conflicts with monomorphism restriction
+ t :: forall (f :: * -> *). Applicative f => (a -> f b) -> f t
+ • In an equation for ‘failing’:
+ failing left right afb s
+ = case pins t of {
+ [] -> right afb s
+ _ -> t afb }
+ where
+ t :: Applicative f => (a -> f b) -> f t
+ Bazaar {getBazaar = t} = left sell s
+ sell :: a -> Bazaar a b b
+ sell w = Bazaar ($ w)
+ ....
diff --git a/testsuite/tests/typecheck/should_compile/T11339b.hs b/testsuite/tests/typecheck/should_compile/T11339b.hs
new file mode 100644
index 0000000000..5401364e77
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11339b.hs
@@ -0,0 +1,32 @@
+{-# LANGUAGE NoMonomorphismRestriction, RankNTypes, ScopedTypeVariables #-}
+
+module T11339b where
+
+import Control.Applicative ( Const(Const, getConst) )
+import Data.Functor.Identity ( Identity(Identity) )
+
+type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
+
+failing :: forall s t a b . Traversal s t a b -> Traversal s t a b -> Traversal s t a b
+failing left right afb s = case pins t of
+ [] -> right afb s
+ _ -> t afb
+ where
+ t :: Applicative f => (a -> f b) -> f t
+ -- Works because of NoMonomorphismRestriction
+ Bazaar { getBazaar = t } = left sell s
+
+ sell :: a -> Bazaar a b b
+ sell w = Bazaar ($ w)
+
+ pins :: ((a -> Const [Identity a] b) -> Const [Identity a] t) -> [Identity a]
+ pins f = getConst (f (\ra -> Const [Identity ra]))
+
+newtype Bazaar a b t = Bazaar { getBazaar :: (forall f. Applicative f => (a -> f b) -> f t) }
+
+instance Functor (Bazaar a b) where
+ fmap f (Bazaar k) = Bazaar (fmap f . k)
+
+instance Applicative (Bazaar a b) where
+ pure a = Bazaar $ \_ -> pure a
+ Bazaar mf <*> Bazaar ma = Bazaar $ \afb -> mf afb <*> ma afb
diff --git a/testsuite/tests/typecheck/should_compile/T11339c.hs b/testsuite/tests/typecheck/should_compile/T11339c.hs
new file mode 100644
index 0000000000..0104a24765
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11339c.hs
@@ -0,0 +1,32 @@
+{-# LANGUAGE MonoLocalBinds, RankNTypes, ScopedTypeVariables #-}
+
+module T11339c where
+
+import Control.Applicative ( Const(Const, getConst) )
+import Data.Functor.Identity ( Identity(Identity) )
+
+type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
+
+failing :: forall s t a b . Traversal s t a b -> Traversal s t a b -> Traversal s t a b
+failing left right afb s = case pins t of
+ [] -> right afb s
+ _ -> t afb
+ where
+ t :: Applicative f => (a -> f b) -> f t
+ -- Works because of MonoLocalBinds
+ Bazaar { getBazaar = t } = left sell s
+
+ sell :: a -> Bazaar a b b
+ sell w = Bazaar ($ w)
+
+ pins :: ((a -> Const [Identity a] b) -> Const [Identity a] t) -> [Identity a]
+ pins f = getConst (f (\ra -> Const [Identity ra]))
+
+newtype Bazaar a b t = Bazaar { getBazaar :: (forall f. Applicative f => (a -> f b) -> f t) }
+
+instance Functor (Bazaar a b) where
+ fmap f (Bazaar k) = Bazaar (fmap f . k)
+
+instance Applicative (Bazaar a b) where
+ pure a = Bazaar $ \_ -> pure a
+ Bazaar mf <*> Bazaar ma = Bazaar $ \afb -> mf afb <*> ma afb
diff --git a/testsuite/tests/typecheck/should_compile/T11339d.hs b/testsuite/tests/typecheck/should_compile/T11339d.hs
new file mode 100644
index 0000000000..cdc1bcf7e4
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11339d.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE NoMonoLocalBinds, RankNTypes #-}
+
+-- Ross Paterson's example from
+-- https://prime.haskell.org/wiki/MonomorphicPatternBindings
+
+module T11339d where
+
+import Control.Monad.ST
+
+newtype ListMap m a b = ListMap ([a] -> m [b])
+
+runMap :: (forall s. ListMap (ST s) a b) -> [a] -> [b]
+runMap lf as = runST (f as)
+ where
+ ListMap f = lf
diff --git a/testsuite/tests/typecheck/should_compile/T11700.hs b/testsuite/tests/typecheck/should_compile/T11700.hs
new file mode 100644
index 0000000000..9cf43af9d9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11700.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE GADTs, TypeFamilies #-} -- Remove this line and the code compiles.
+
+module T11700 where
+
+data Muse
+data Message
+data Folder
+
+class PersistEntity record
+
+data Entity record where
+ Entity :: PersistEntity record => record -> Entity record
+
+fn1 :: (Entity Muse, Entity Message) -> Message
+fn1 cluster = let (Entity foo, Entity msg) = cluster
+ in msg
+-- fn1 (Entity foo, Entity msg) = msg
+
diff --git a/testsuite/tests/typecheck/should_compile/T12069.hs b/testsuite/tests/typecheck/should_compile/T12069.hs
new file mode 100644
index 0000000000..0da87dc7e6
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12069.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+module T12069 where
+
+foo (_ :: p a) = [] :: [a]
diff --git a/testsuite/tests/typecheck/should_compile/T2357.hs b/testsuite/tests/typecheck/should_compile/T2357.hs
index cdc77c1507..61d95f1045 100644
--- a/testsuite/tests/typecheck/should_compile/T2357.hs
+++ b/testsuite/tests/typecheck/should_compile/T2357.hs
@@ -1,7 +1,11 @@
+{-# LANGUAGE NoMonomorphismRestriction #-}
+
module Foo where
-f :: Show a => a
-(f, _) = undefined
+f :: Read a => a
+-- This one needs NoMonomorphismRestriction else f could
+-- not get a polymoprhic type
+(f, _) = (read "3", True)
-g :: Show a => a
+g :: Read a => a
g = f
diff --git a/testsuite/tests/typecheck/should_compile/T2494.stderr b/testsuite/tests/typecheck/should_compile/T2494.stderr
index b398459aa9..93c46fce53 100644
--- a/testsuite/tests/typecheck/should_compile/T2494.stderr
+++ b/testsuite/tests/typecheck/should_compile/T2494.stderr
@@ -1,36 +1,36 @@
-
-T2494.hs:15:14: error:
- • Couldn't match type ‘b’ with ‘a’
- ‘b’ is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:14:16
- ‘a’ is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:13:16
- Expected type: Maybe (m a) -> Maybe (m a)
- Actual type: Maybe (m b) -> Maybe (m b)
- • In the first argument of ‘foo’, namely ‘g’
- In the second argument of ‘foo’, namely ‘(foo g x)’
- In the expression: foo f (foo g x)
- • Relevant bindings include
- f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
- (bound at T2494.hs:13:11)
- g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
- (bound at T2494.hs:14:11)
- x :: Maybe a (bound at T2494.hs:14:65)
-
-T2494.hs:15:30: error:
- • Couldn't match type ‘b’ with ‘a’
- ‘b’ is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:14:16
- ‘a’ is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:13:16
- Expected type: Maybe (m b) -> Maybe (m a)
- Actual type: Maybe (m b) -> Maybe (m b)
- • In the second argument of ‘(.)’, namely ‘g’
- In the first argument of ‘foo’, namely ‘(f . g)’
- In the expression: foo (f . g) x
- • Relevant bindings include
- f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
- (bound at T2494.hs:13:11)
- g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
- (bound at T2494.hs:14:11)
- x :: Maybe a (bound at T2494.hs:14:65)
+
+T2494.hs:15:14: error:
+ • Couldn't match type ‘b’ with ‘a’
+ ‘b’ is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:14:16-62
+ ‘a’ is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:13:16-62
+ Expected type: Maybe (m a) -> Maybe (m a)
+ Actual type: Maybe (m b) -> Maybe (m b)
+ • In the first argument of ‘foo’, namely ‘g’
+ In the second argument of ‘foo’, namely ‘(foo g x)’
+ In the expression: foo f (foo g x)
+ • Relevant bindings include
+ f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
+ (bound at T2494.hs:13:11)
+ g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
+ (bound at T2494.hs:14:11)
+ x :: Maybe a (bound at T2494.hs:14:65)
+
+T2494.hs:15:30: error:
+ • Couldn't match type ‘b’ with ‘a’
+ ‘b’ is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:14:16-62
+ ‘a’ is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:13:16-62
+ Expected type: Maybe (m b) -> Maybe (m a)
+ Actual type: Maybe (m b) -> Maybe (m b)
+ • In the second argument of ‘(.)’, namely ‘g’
+ In the first argument of ‘foo’, namely ‘(f . g)’
+ In the expression: foo (f . g) x
+ • Relevant bindings include
+ f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
+ (bound at T2494.hs:13:11)
+ g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
+ (bound at T2494.hs:14:11)
+ x :: Maybe a (bound at T2494.hs:14:65)
diff --git a/testsuite/tests/typecheck/should_compile/T9834.stderr b/testsuite/tests/typecheck/should_compile/T9834.stderr
index 9e66a49770..75392ea2ba 100644
--- a/testsuite/tests/typecheck/should_compile/T9834.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9834.stderr
@@ -1,46 +1,46 @@
-
-T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘p’ with ‘(->) (p a0)’
- ‘p’ is a rigid type variable bound by
- the class declaration for ‘ApplicativeFix’ at T9834.hs:21:39
- Expected type: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- Actual type: (forall (q :: * -> *).
- Applicative q =>
- Nat (Comp p q) (Comp p q))
- -> p a0 -> p a0
- • In the expression: wrapIdComp
- In an equation for ‘afix’: afix = wrapIdComp
- • Relevant bindings include
- afix :: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- (bound at T9834.hs:23:3)
-
-T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Couldn't match type ‘a’ with ‘a1’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- afix :: forall a.
- (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
- -> p a
- at T9834.hs:22:11
- ‘a1’ is a rigid type variable bound by
- a type expected by the context:
- forall (q :: * -> *) a1.
- Applicative q =>
- Comp p q a1 -> Comp p q a1
- at T9834.hs:23:10
- Expected type: Comp p q a1 -> Comp p q a1
- Actual type: Comp p q a -> Comp p q a
- • In the expression: wrapIdComp
- In an equation for ‘afix’: afix = wrapIdComp
- • Relevant bindings include
- afix :: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- (bound at T9834.hs:23:3)
+
+T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘p’ with ‘(->) (p a0)’
+ ‘p’ is a rigid type variable bound by
+ the class declaration for ‘ApplicativeFix’ at T9834.hs:21:39
+ Expected type: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ Actual type: (forall (q :: * -> *).
+ Applicative q =>
+ Nat (Comp p q) (Comp p q))
+ -> p a0 -> p a0
+ • In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
+ • Relevant bindings include
+ afix :: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ (bound at T9834.hs:23:3)
+
+T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘a’ with ‘a1’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ afix :: forall a.
+ (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
+ -> p a
+ at T9834.hs:22:11-74
+ ‘a1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall (q :: * -> *) a1.
+ Applicative q =>
+ Comp p q a1 -> Comp p q a1
+ at T9834.hs:23:10-19
+ Expected type: Comp p q a1 -> Comp p q a1
+ Actual type: Comp p q a -> Comp p q a
+ • In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
+ • Relevant bindings include
+ afix :: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ (bound at T9834.hs:23:3)
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index d10c51016d..5e227b2702 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9939.stderr
@@ -1,20 +1,20 @@
-
-T9939.hs:5:1: warning: [-Wredundant-constraints (in -Wall)]
- • Redundant constraint: Eq a
- • In the type signature for:
- f1 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:9:1: warning: [-Wredundant-constraints (in -Wall)]
- • Redundant constraint: Eq a
- • In the type signature for:
- f2 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:13:1: warning: [-Wredundant-constraints (in -Wall)]
- • Redundant constraint: Eq b
- • In the type signature for:
- f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
-
-T9939.hs:20:1: warning: [-Wredundant-constraints (in -Wall)]
- • Redundant constraint: Eq a
- • In the type signature for:
- f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
+
+T9939.hs:5:1: warning: [-Wredundant-constraints (in -Wall)]
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f1 :: (Eq a, Ord a) => a -> a -> Bool
+
+T9939.hs:9:1: warning: [-Wredundant-constraints (in -Wall)]
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f2 :: (Eq a, Ord a) => a -> a -> Bool
+
+T9939.hs:13:1: warning: [-Wredundant-constraints (in -Wall)]
+ • Redundant constraint: Eq b
+ • In the type signature for:
+ f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
+
+T9939.hs:20:1: warning: [-Wredundant-constraints (in -Wall)]
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 0f43d00e6f..3b6e186d8c 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -517,3 +517,12 @@ test('T11348', normal, compile, [''])
test('T11947', normal, compile, [''])
test('T12064', extra_clean(['T12064.hi-boot', 'T12064.o-boot', 'T11062a.hi', 'T11062a.o']),
multimod_compile, ['T12064', '-v0'])
+test('ExPat', normal, compile, [''])
+test('ExPatFail', normal, compile_fail, [''])
+test('SigTyVars', normal, compile, [''])
+test('T12069', normal, compile, [''])
+test('T11700', normal, compile, [''])
+test('T11339', normal, compile_fail, [''])
+test('T11339b', normal, compile, [''])
+test('T11339c', normal, compile, [''])
+test('T11339d', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index 0d0582d126..6bb117796f 100644
--- a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ -1,33 +1,33 @@
-
-holes.hs:3:5: warning: [-Wtyped-holes (in -Wdefault)]
- • Found hole: _ :: t
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of f :: t at holes.hs:3:1
- • In the expression: _
- In an equation for ‘f’: f = _
- • Relevant bindings include f :: t (bound at holes.hs:3:1)
-
-holes.hs:6:7: warning: [-Wtyped-holes (in -Wdefault)]
- • Found hole: _ :: Char
- • In the expression: _
- In an equation for ‘g’: g x = _
- • Relevant bindings include
- x :: Int (bound at holes.hs:6:3)
- g :: Int -> Char (bound at holes.hs:6:1)
-
-holes.hs:8:5: warning: [-Wtyped-holes (in -Wdefault)]
- • Found hole: _ :: [Char]
- • In the first argument of ‘(++)’, namely ‘_’
- In the expression: _ ++ "a"
- In an equation for ‘h’: h = _ ++ "a"
- • Relevant bindings include h :: [Char] (bound at holes.hs:8:1)
-
-holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
- • Found hole: _ :: b0
- Where: ‘b0’ is an ambiguous type variable
- • In the second argument of ‘const’, namely ‘_’
- In the expression: const y _
- In an equation for ‘z’: z y = const y _
- • Relevant bindings include
- y :: [a] (bound at holes.hs:11:3)
- z :: [a] -> [a] (bound at holes.hs:11:1)
+
+holes.hs:3:5: warning: [-Wtyped-holes (in -Wdefault)]
+ • Found hole: _ :: t
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of f :: t at holes.hs:3:1-5
+ • In the expression: _
+ In an equation for ‘f’: f = _
+ • Relevant bindings include f :: t (bound at holes.hs:3:1)
+
+holes.hs:6:7: warning: [-Wtyped-holes (in -Wdefault)]
+ • Found hole: _ :: Char
+ • In the expression: _
+ In an equation for ‘g’: g x = _
+ • Relevant bindings include
+ x :: Int (bound at holes.hs:6:3)
+ g :: Int -> Char (bound at holes.hs:6:1)
+
+holes.hs:8:5: warning: [-Wtyped-holes (in -Wdefault)]
+ • Found hole: _ :: [Char]
+ • In the first argument of ‘(++)’, namely ‘_’
+ In the expression: _ ++ "a"
+ In an equation for ‘h’: h = _ ++ "a"
+ • Relevant bindings include h :: [Char] (bound at holes.hs:8:1)
+
+holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
+ • Found hole: _ :: b0
+ Where: ‘b0’ is an ambiguous type variable
+ • In the second argument of ‘const’, namely ‘_’
+ In the expression: const y _
+ In an equation for ‘z’: z y = const y _
+ • Relevant bindings include
+ y :: [a] (bound at holes.hs:11:3)
+ z :: [a] -> [a] (bound at holes.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr
index 2d1261b278..7edaed8e3e 100644
--- a/testsuite/tests/typecheck/should_compile/holes3.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes3.stderr
@@ -1,36 +1,36 @@
-
-holes3.hs:3:5: error:
- • Found hole: _ :: t
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of f :: t at holes3.hs:3:1
- • In the expression: _
- In an equation for ‘f’: f = _
- • Relevant bindings include f :: t (bound at holes3.hs:3:1)
-
-holes3.hs:6:7: error:
- • Found hole: _gr :: Char
- Or perhaps ‘_gr’ is mis-spelled, or not in scope
- • In the expression: _gr
- In an equation for ‘g’: g x = _gr
- • Relevant bindings include
- x :: Int (bound at holes3.hs:6:3)
- g :: Int -> Char (bound at holes3.hs:6:1)
-
-holes3.hs:8:5: error:
- • Found hole: _aa :: [Char]
- Or perhaps ‘_aa’ is mis-spelled, or not in scope
- • In the first argument of ‘(++)’, namely ‘_aa’
- In the expression: _aa ++ "a"
- In an equation for ‘h’: h = _aa ++ "a"
- • Relevant bindings include h :: [Char] (bound at holes3.hs:8:1)
-
-holes3.hs:11:15: error:
- • Found hole: _x :: b0
- Where: ‘b0’ is an ambiguous type variable
- Or perhaps ‘_x’ is mis-spelled, or not in scope
- • In the second argument of ‘const’, namely ‘_x’
- In the expression: const y _x
- In an equation for ‘z’: z y = const y _x
- • Relevant bindings include
- y :: [a] (bound at holes3.hs:11:3)
- z :: [a] -> [a] (bound at holes3.hs:11:1)
+
+holes3.hs:3:5: error:
+ • Found hole: _ :: t
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of f :: t at holes3.hs:3:1-5
+ • In the expression: _
+ In an equation for ‘f’: f = _
+ • Relevant bindings include f :: t (bound at holes3.hs:3:1)
+
+holes3.hs:6:7: error:
+ • Found hole: _gr :: Char
+ Or perhaps ‘_gr’ is mis-spelled, or not in scope
+ • In the expression: _gr
+ In an equation for ‘g’: g x = _gr
+ • Relevant bindings include
+ x :: Int (bound at holes3.hs:6:3)
+ g :: Int -> Char (bound at holes3.hs:6:1)
+
+holes3.hs:8:5: error:
+ • Found hole: _aa :: [Char]
+ Or perhaps ‘_aa’ is mis-spelled, or not in scope
+ • In the first argument of ‘(++)’, namely ‘_aa’
+ In the expression: _aa ++ "a"
+ In an equation for ‘h’: h = _aa ++ "a"
+ • Relevant bindings include h :: [Char] (bound at holes3.hs:8:1)
+
+holes3.hs:11:15: error:
+ • Found hole: _x :: b0
+ Where: ‘b0’ is an ambiguous type variable
+ Or perhaps ‘_x’ is mis-spelled, or not in scope
+ • In the second argument of ‘const’, namely ‘_x’
+ In the expression: const y _x
+ In an equation for ‘z’: z y = const y _x
+ • Relevant bindings include
+ y :: [a] (bound at holes3.hs:11:3)
+ z :: [a] -> [a] (bound at holes3.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_compile/tc141.stderr b/testsuite/tests/typecheck/should_compile/tc141.stderr
index 49a26d6363..ab778a0133 100644
--- a/testsuite/tests/typecheck/should_compile/tc141.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc141.stderr
@@ -1,54 +1,54 @@
-
-tc141.hs:11:12: error:
- • You cannot bind scoped type variable ‘a’
- in a pattern binding signature
- • In the pattern: p :: a
- In the pattern: (p :: a, q :: a)
- In a pattern binding: (p :: a, q :: a) = x
-
-tc141.hs:11:31: error:
- • Couldn't match expected type ‘a1’ with actual type ‘a’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature:
- a1
- at tc141.hs:11:31-34
- • In the expression: q :: a
- In the expression: (q :: a, p)
- In the expression: let (p :: a, q :: a) = x in (q :: a, p)
- • Relevant bindings include
- p :: a (bound at tc141.hs:11:12)
- q :: a (bound at tc141.hs:11:17)
- x :: (a, a) (bound at tc141.hs:11:3)
- f :: (a, a) -> (t, a) (bound at tc141.hs:11:1)
-
-tc141.hs:13:13: error:
- • You cannot bind scoped type variable ‘a’
- in a pattern binding signature
- • In the pattern: y :: a
- In a pattern binding: y :: a = a
- In the expression:
- let y :: a = a in
- let
- v :: a
- v = b
- in v
-
-tc141.hs:15:18: error:
- • Couldn't match expected type ‘a1’ with actual type ‘t’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for:
- v :: a1
- at tc141.hs:14:14-19
- • In the expression: b
- In an equation for ‘v’: v = b
- In the expression:
- let
- v :: a
- v = b
- in v
- • Relevant bindings include
- v :: a1 (bound at tc141.hs:15:14)
- b :: t (bound at tc141.hs:13:5)
- g :: t1 -> t -> forall a. a (bound at tc141.hs:13:1)
+
+tc141.hs:11:12: error:
+ • You cannot bind scoped type variable ‘a’
+ in a pattern binding signature
+ • In the pattern: p :: a
+ In the pattern: (p :: a, q :: a)
+ In a pattern binding: (p :: a, q :: a) = x
+
+tc141.hs:11:31: error:
+ • Couldn't match expected type ‘a1’ with actual type ‘a’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ a1
+ at tc141.hs:11:34
+ • In the expression: q :: a
+ In the expression: (q :: a, p)
+ In the expression: let (p :: a, q :: a) = x in (q :: a, p)
+ • Relevant bindings include
+ p :: a (bound at tc141.hs:11:12)
+ q :: a (bound at tc141.hs:11:17)
+ x :: (a, a) (bound at tc141.hs:11:3)
+ f :: (a, a) -> (t, a) (bound at tc141.hs:11:1)
+
+tc141.hs:13:13: error:
+ • You cannot bind scoped type variable ‘a’
+ in a pattern binding signature
+ • In the pattern: y :: a
+ In a pattern binding: y :: a = a
+ In the expression:
+ let y :: a = a in
+ let
+ v :: a
+ v = b
+ in v
+
+tc141.hs:15:18: error:
+ • Couldn't match expected type ‘a1’ with actual type ‘t’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ v :: a1
+ at tc141.hs:14:14-19
+ • In the expression: b
+ In an equation for ‘v’: v = b
+ In the expression:
+ let
+ v :: a
+ v = b
+ in v
+ • Relevant bindings include
+ v :: a1 (bound at tc141.hs:15:14)
+ b :: t (bound at tc141.hs:13:5)
+ g :: t1 -> t -> forall a. a (bound at tc141.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr
index ebc5f97503..a8e5b011e4 100644
--- a/testsuite/tests/typecheck/should_fail/T10285.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10285.stderr
@@ -1,22 +1,22 @@
-
-T10285.hs:8:17: error:
- • Could not deduce: Coercible a b arising from a use of ‘coerce’
- from the context: Coercible (N a) (N b)
- bound by a pattern with constructor:
- Coercion :: forall k (a :: k) (b :: k).
- Coercible a b =>
- Coercion a b,
- in an equation for ‘oops’
- at T10285.hs:8:6-13
- ‘a’ is a rigid type variable bound by
- the type signature for:
- oops :: forall a b. Coercion (N a) (N b) -> a -> b
- at T10285.hs:7:9
- ‘b’ is a rigid type variable bound by
- the type signature for:
- oops :: forall a b. Coercion (N a) (N b) -> a -> b
- at T10285.hs:7:9
- • In the expression: coerce
- In an equation for ‘oops’: oops Coercion = coerce
- • Relevant bindings include
- oops :: Coercion (N a) (N b) -> a -> b (bound at T10285.hs:8:1)
+
+T10285.hs:8:17: error:
+ • Could not deduce: Coercible a b arising from a use of ‘coerce’
+ from the context: Coercible (N a) (N b)
+ bound by a pattern with constructor:
+ Coercion :: forall k (a :: k) (b :: k).
+ Coercible a b =>
+ Coercion a b,
+ in an equation for ‘oops’
+ at T10285.hs:8:6-13
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ oops :: forall a b. Coercion (N a) (N b) -> a -> b
+ at T10285.hs:7:1-38
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ oops :: forall a b. Coercion (N a) (N b) -> a -> b
+ at T10285.hs:7:1-38
+ • In the expression: coerce
+ In an equation for ‘oops’: oops Coercion = coerce
+ • Relevant bindings include
+ oops :: Coercion (N a) (N b) -> a -> b (bound at T10285.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr
index ecdb6d2935..5ba1c89d27 100644
--- a/testsuite/tests/typecheck/should_fail/T10534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10534.stderr
@@ -1,19 +1,19 @@
-
-T10534a.hs:10:9: error:
- • Could not deduce: Coercible a b arising from a use of ‘coerce’
- from the context: Coercible (DF a) (DF b)
- bound by the type signature for:
- silly :: Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:1-42
- ‘a’ is a rigid type variable bound by
- the type signature for:
- silly :: forall a b. Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:10
- ‘b’ is a rigid type variable bound by
- the type signature for:
- silly :: forall a b. Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:10
- • In the expression: coerce
- In an equation for ‘silly’: silly = coerce
- • Relevant bindings include
- silly :: a -> b (bound at T10534a.hs:10:1)
+
+T10534a.hs:10:9: error:
+ • Could not deduce: Coercible a b arising from a use of ‘coerce’
+ from the context: Coercible (DF a) (DF b)
+ bound by the type signature for:
+ silly :: Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:1-42
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ silly :: forall a b. Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:1-42
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ silly :: forall a b. Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:1-42
+ • In the expression: coerce
+ In an equation for ‘silly’: silly = coerce
+ • Relevant bindings include
+ silly :: a -> b (bound at T10534a.hs:10:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10715.stderr b/testsuite/tests/typecheck/should_fail/T10715.stderr
index 0bbaa35573..9b98acbfb5 100644
--- a/testsuite/tests/typecheck/should_fail/T10715.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10715.stderr
@@ -1,14 +1,13 @@
-
-T10715.hs:9:13: error:
- Couldn't match representation of type ‘a’ with that of ‘X a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- doCoerce :: forall a. Coercible a (X a) => a -> X a
- at T10715.hs:9:13
- Inaccessible code in
- the type signature for:
- doCoerce :: Coercible a (X a) => a -> X a
- In the ambiguity check for ‘doCoerce’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- doCoerce :: Coercible a (X a) => a -> X a
+
+T10715.hs:9:13: error:
+ • Couldn't match representation of type ‘a’ with that of ‘X a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ doCoerce :: forall a. Coercible a (X a) => a -> X a
+ at T10715.hs:9:13-41
+ Inaccessible code in
+ the type signature for:
+ doCoerce :: Coercible a (X a) => a -> X a
+ • In the ambiguity check for ‘doCoerce’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: doCoerce :: Coercible a (X a) => a -> X a
diff --git a/testsuite/tests/typecheck/should_fail/T11347.stderr b/testsuite/tests/typecheck/should_fail/T11347.stderr
index 6154984201..54061068c6 100644
--- a/testsuite/tests/typecheck/should_fail/T11347.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11347.stderr
@@ -1,11 +1,11 @@
-
-T11347.hs:6:41: error:
- • Couldn't match representation of type ‘a’ with that of ‘b’
- arising from the coercion of the method ‘unsafe’
- from type ‘Id1 a -> Discern (Id1 a) b’
- to type ‘Id2 a -> Discern (Id2 a) b’
- ‘a’ is a rigid type variable bound by
- the deriving clause for ‘UnsafeCast b (Id2 a)’ at T11347.hs:6:41
- ‘b’ is a rigid type variable bound by
- the deriving clause for ‘UnsafeCast b (Id2 a)’ at T11347.hs:6:41
- • When deriving the instance for (UnsafeCast b (Id2 a))
+
+T11347.hs:6:41: error:
+ • Couldn't match representation of type ‘a’ with that of ‘b’
+ arising from the coercion of the method ‘unsafe’
+ from type ‘Id1 a -> Discern (Id1 a) b’
+ to type ‘Id2 a -> Discern (Id2 a) b’
+ ‘a’ is a rigid type variable bound by
+ the deriving clause for ‘UnsafeCast b (Id2 a)’ at T11347.hs:6:41-52
+ ‘b’ is a rigid type variable bound by
+ the deriving clause for ‘UnsafeCast b (Id2 a)’ at T11347.hs:6:41-52
+ • When deriving the instance for (UnsafeCast b (Id2 a))
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index c4db8fe1e7..c88ae9ace2 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -1,15 +1,15 @@
-
-T1899.hs:14:36: error:
- • Couldn't match type ‘a’ with ‘Proposition a0’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- transRHS :: forall a. [a] -> Int -> Constraint a
- at T1899.hs:9:14
- Expected type: [Proposition a0]
- Actual type: [a]
- • In the first argument of ‘Auxiliary’, namely ‘varSet’
- In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
- In the expression: Prop (Auxiliary varSet)
- • Relevant bindings include
- varSet :: [a] (bound at T1899.hs:10:11)
- transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
+
+T1899.hs:14:36: error:
+ • Couldn't match type ‘a’ with ‘Proposition a0’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ transRHS :: forall a. [a] -> Int -> Constraint a
+ at T1899.hs:9:2-39
+ Expected type: [Proposition a0]
+ Actual type: [a]
+ • In the first argument of ‘Auxiliary’, namely ‘varSet’
+ In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
+ In the expression: Prop (Auxiliary varSet)
+ • Relevant bindings include
+ varSet :: [a] (bound at T1899.hs:10:11)
+ transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
diff --git a/testsuite/tests/typecheck/should_fail/T2714.stderr b/testsuite/tests/typecheck/should_fail/T2714.stderr
index bba821bcac..f60855d682 100644
--- a/testsuite/tests/typecheck/should_fail/T2714.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2714.stderr
@@ -1,13 +1,13 @@
-
-T2714.hs:8:5: error:
- • Couldn't match type ‘a’ with ‘f0 b’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a b. ((a -> b) -> b) -> forall c. c -> a
- at T2714.hs:7:6
- Expected type: ((a -> b) -> b) -> c -> a
- Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
- • In the expression: ffmap
- In an equation for ‘f’: f = ffmap
- • Relevant bindings include
- f :: ((a -> b) -> b) -> forall c. c -> a (bound at T2714.hs:8:1)
+
+T2714.hs:8:5: error:
+ • Couldn't match type ‘a’ with ‘f0 b’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a b. ((a -> b) -> b) -> forall c. c -> a
+ at T2714.hs:7:1-42
+ Expected type: ((a -> b) -> b) -> c -> a
+ Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
+ • In the expression: ffmap
+ In an equation for ‘f’: f = ffmap
+ • Relevant bindings include
+ f :: ((a -> b) -> b) -> forall c. c -> a (bound at T2714.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T3102.stderr b/testsuite/tests/typecheck/should_fail/T3102.stderr
index a5a410efeb..6ff8d1cb67 100644
--- a/testsuite/tests/typecheck/should_fail/T3102.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3102.stderr
@@ -1,12 +1,12 @@
-
-T3102.hs:11:12: error:
- • Couldn't match type ‘a’ with ‘(?p::Int) => a0’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. a -> String
- at T3102.hs:11:10
- Expected type: a -> String
- Actual type: ((?p::Int) => a0) -> String
- • In the first argument of ‘f’, namely ‘t’
- In the expression: f t
- In an equation for ‘result’: result = f t
+
+T3102.hs:11:12: error:
+ • Couldn't match type ‘a’ with ‘(?p::Int) => a0’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. a -> String
+ at T3102.hs:11:10-12
+ Expected type: a -> String
+ Actual type: ((?p::Int) => a0) -> String
+ • In the first argument of ‘f’, namely ‘t’
+ In the expression: f t
+ In an equation for ‘result’: result = f t
diff --git a/testsuite/tests/typecheck/should_fail/T5691.stderr b/testsuite/tests/typecheck/should_fail/T5691.stderr
index 132df4dacf..585dcdf71c 100644
--- a/testsuite/tests/typecheck/should_fail/T5691.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5691.stderr
@@ -1,19 +1,19 @@
-
-T5691.hs:14:9: error:
- Couldn't match type ‘p’ with ‘PrintRuleInterp’
- Expected type: p a
- Actual type: PrintRuleInterp a
- When checking that the pattern signature: p a
- fits the type of its context: PrintRuleInterp a
- In the pattern: f :: p a
- In an equation for ‘test’: test (f :: p a) = MkPRI $ printRule_ f
-
-T5691.hs:24:10: error:
- No instance for (Alternative RecDecParser)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘MonadPlus RecDecParser’
-
-T5691.hs:24:10: error:
- No instance for (Monad RecDecParser)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘MonadPlus RecDecParser’
+
+T5691.hs:15:24: error:
+ • Couldn't match type ‘p’ with ‘PrintRuleInterp’
+ Expected type: PrintRuleInterp a
+ Actual type: p a
+ • In the first argument of ‘printRule_’, namely ‘f’
+ In the second argument of ‘($)’, namely ‘printRule_ f’
+ In the expression: MkPRI $ printRule_ f
+ • Relevant bindings include f :: p a (bound at T5691.hs:14:9)
+
+T5691.hs:24:10: error:
+ • No instance for (Alternative RecDecParser)
+ arising from the superclasses of an instance declaration
+ • In the instance declaration for ‘MonadPlus RecDecParser’
+
+T5691.hs:24:10: error:
+ • No instance for (Monad RecDecParser)
+ arising from the superclasses of an instance declaration
+ • In the instance declaration for ‘MonadPlus RecDecParser’
diff --git a/testsuite/tests/typecheck/should_fail/T7264.stderr b/testsuite/tests/typecheck/should_fail/T7264.stderr
index b343d88cd1..57d3699a37 100644
--- a/testsuite/tests/typecheck/should_fail/T7264.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7264.stderr
@@ -1,13 +1,13 @@
-
-T7264.hs:13:19: error:
- • Couldn't match type ‘a’ with ‘forall r. r -> String’
- ‘a’ is a rigid type variable bound by
- the inferred type of mkFoo2 :: a -> Maybe Foo at T7264.hs:13:1
- Expected type: a -> Foo
- Actual type: (forall r. r -> String) -> Foo
- • In the first argument of ‘mmap’, namely ‘Foo’
- In the expression: mmap Foo (Just val)
- In an equation for ‘mkFoo2’: mkFoo2 val = mmap Foo (Just val)
- • Relevant bindings include
- val :: a (bound at T7264.hs:13:8)
- mkFoo2 :: a -> Maybe Foo (bound at T7264.hs:13:1)
+
+T7264.hs:13:19: error:
+ • Couldn't match type ‘a’ with ‘forall r. r -> String’
+ ‘a’ is a rigid type variable bound by
+ the inferred type of mkFoo2 :: a -> Maybe Foo at T7264.hs:13:1-32
+ Expected type: a -> Foo
+ Actual type: (forall r. r -> String) -> Foo
+ • In the first argument of ‘mmap’, namely ‘Foo’
+ In the expression: mmap Foo (Just val)
+ In an equation for ‘mkFoo2’: mkFoo2 val = mmap Foo (Just val)
+ • Relevant bindings include
+ val :: a (bound at T7264.hs:13:8)
+ mkFoo2 :: a -> Maybe Foo (bound at T7264.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7748a.stderr b/testsuite/tests/typecheck/should_fail/T7748a.stderr
index 2f4c35598f..d63f406ce4 100644
--- a/testsuite/tests/typecheck/should_fail/T7748a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7748a.stderr
@@ -1,20 +1,20 @@
-
-T7748a.hs:16:24: error:
- • Couldn't match expected type ‘a’
- with actual type ‘Maybe (Maybe (r -> ()))’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- test :: forall a r. a -> r -> ()
- at T7748a.hs:11:9
- • In the pattern: Just (Just p)
- In a case alternative: Just (Just p) -> p
- In the expression:
- case zd of {
- Nothing -> const ()
- Just Nothing -> const ()
- Just (Just p) -> p }
- • Relevant bindings include
- g :: r -> () (bound at T7748a.hs:13:16)
- f :: r -> () (bound at T7748a.hs:13:8)
- zd :: a (bound at T7748a.hs:12:6)
- test :: a -> r -> () (bound at T7748a.hs:12:1)
+
+T7748a.hs:16:24: error:
+ • Couldn't match expected type ‘a’
+ with actual type ‘Maybe (Maybe (r -> ()))’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ test :: forall a r. a -> r -> ()
+ at T7748a.hs:11:1-20
+ • In the pattern: Just (Just p)
+ In a case alternative: Just (Just p) -> p
+ In the expression:
+ case zd of {
+ Nothing -> const ()
+ Just Nothing -> const ()
+ Just (Just p) -> p }
+ • Relevant bindings include
+ g :: r -> () (bound at T7748a.hs:13:16)
+ f :: r -> () (bound at T7748a.hs:13:8)
+ zd :: a (bound at T7748a.hs:12:6)
+ test :: a -> r -> () (bound at T7748a.hs:12:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7869.stderr b/testsuite/tests/typecheck/should_fail/T7869.stderr
index 44902922a6..95dc5a9ca4 100644
--- a/testsuite/tests/typecheck/should_fail/T7869.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7869.stderr
@@ -1,14 +1,14 @@
-
-T7869.hs:3:12: error:
- • Couldn't match type ‘b’ with ‘b1’
- because type variable ‘b1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature:
- [a1] -> b1
- at T7869.hs:3:5-27
- Expected type: [a1] -> b1
- Actual type: [a] -> b
- • In the expression: f x
- In the expression: (\ x -> f x) :: [a] -> b
- In an equation for ‘f’: f = (\ x -> f x) :: [a] -> b
- • Relevant bindings include f :: [a] -> b (bound at T7869.hs:3:1)
+
+T7869.hs:3:12: error:
+ • Couldn't match type ‘b’ with ‘b1’
+ because type variable ‘b1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ [a1] -> b1
+ at T7869.hs:3:20-27
+ Expected type: [a1] -> b1
+ Actual type: [a] -> b
+ • In the expression: f x
+ In the expression: (\ x -> f x) :: [a] -> b
+ In an equation for ‘f’: f = (\ x -> f x) :: [a] -> b
+ • Relevant bindings include f :: [a] -> b (bound at T7869.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/T8450.stderr b/testsuite/tests/typecheck/should_fail/T8450.stderr
index 5697e4db2b..c5a751d867 100644
--- a/testsuite/tests/typecheck/should_fail/T8450.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8450.stderr
@@ -1,11 +1,11 @@
-
-T8450.hs:8:7: error:
- • Couldn't match expected type ‘a’ with actual type ‘()’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- run :: forall a. a
- at T8450.hs:7:15
- • In the expression: runEffect $ (undefined :: Either a ())
- In an equation for ‘run’:
- run = runEffect $ (undefined :: Either a ())
- • Relevant bindings include run :: a (bound at T8450.hs:8:1)
+
+T8450.hs:8:7: error:
+ • Couldn't match expected type ‘a’ with actual type ‘()’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ run :: forall a. a
+ at T8450.hs:7:1-18
+ • In the expression: runEffect $ (undefined :: Either a ())
+ In an equation for ‘run’:
+ run = runEffect $ (undefined :: Either a ())
+ • Relevant bindings include run :: a (bound at T8450.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9109.stderr b/testsuite/tests/typecheck/should_fail/T9109.stderr
index 71d88efdc8..996da6e534 100644
--- a/testsuite/tests/typecheck/should_fail/T9109.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9109.stderr
@@ -1,15 +1,15 @@
-
-T9109.hs:8:13: error:
- • Couldn't match expected type ‘t’ with actual type ‘Bool’
- ‘t’ is untouchable
- inside the constraints: t1 ~ Bool
- bound by a pattern with constructor: GBool :: G Bool,
- in an equation for ‘foo’
- at T9109.hs:8:5-9
- ‘t’ is a rigid type variable bound by
- the inferred type of foo :: G t1 -> t at T9109.hs:8:1
- Possible fix: add a type signature for ‘foo’
- • In the expression: True
- In an equation for ‘foo’: foo GBool = True
- • Relevant bindings include
- foo :: G t1 -> t (bound at T9109.hs:8:1)
+
+T9109.hs:8:13: error:
+ • Couldn't match expected type ‘t’ with actual type ‘Bool’
+ ‘t’ is untouchable
+ inside the constraints: t1 ~ Bool
+ bound by a pattern with constructor: GBool :: G Bool,
+ in an equation for ‘foo’
+ at T9109.hs:8:5-9
+ ‘t’ is a rigid type variable bound by
+ the inferred type of foo :: G t1 -> t at T9109.hs:8:1-16
+ Possible fix: add a type signature for ‘foo’
+ • In the expression: True
+ In an equation for ‘foo’: foo GBool = True
+ • Relevant bindings include
+ foo :: G t1 -> t (bound at T9109.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/mc19.stderr b/testsuite/tests/typecheck/should_fail/mc19.stderr
index 5f004dc4a8..4b00eeaecc 100644
--- a/testsuite/tests/typecheck/should_fail/mc19.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc19.stderr
@@ -1,12 +1,12 @@
-
-mc19.hs:10:31: error:
- • Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [a]
- at mc19.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- • In the expression: inits
- In a stmt of a monad comprehension: then inits
- In the expression: [x | x <- [3, 2, 1], then inits]
+
+mc19.hs:10:31: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at mc19.hs:10:10-35
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ • In the expression: inits
+ In a stmt of a monad comprehension: then inits
+ In the expression: [x | x <- [3, 2, 1], then inits]
diff --git a/testsuite/tests/typecheck/should_fail/mc21.stderr b/testsuite/tests/typecheck/should_fail/mc21.stderr
index 74a13b14bc..d650f0ebda 100644
--- a/testsuite/tests/typecheck/should_fail/mc21.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc21.stderr
@@ -1,13 +1,13 @@
-
-mc21.hs:12:26: error:
- • Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [[a]]
- at mc21.hs:11:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- • In the expression: take 5
- In a stmt of a monad comprehension: then group using take 5
- In the expression:
- [GHC.List.length x | x <- [Gnorf, Brain], then group using take 5]
+
+mc21.hs:12:26: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at mc21.hs:(11,9)-(12,31)
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ • In the expression: take 5
+ In a stmt of a monad comprehension: then group using take 5
+ In the expression:
+ [GHC.List.length x | x <- [Gnorf, Brain], then group using take 5]
diff --git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr
index d15dd7bde3..a394859f1d 100644
--- a/testsuite/tests/typecheck/should_fail/mc22.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc22.stderr
@@ -1,15 +1,15 @@
-
-mc22.hs:10:26: error:
- • Couldn't match type ‘a’ with ‘t a’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [t a]
- at mc22.hs:9:9
- Expected type: [a] -> [t a]
- Actual type: [t a] -> [t a]
- • In the expression: take 5
- In a stmt of a monad comprehension: then group using take 5
- In the expression:
- [x + 1 | x <- ["Hello", "World"], then group using take 5]
- • Relevant bindings include
- foo :: [t [Char]] (bound at mc22.hs:8:1)
+
+mc22.hs:10:26: error:
+ • Couldn't match type ‘a’ with ‘t a’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [t a]
+ at mc22.hs:(9,9)-(10,31)
+ Expected type: [a] -> [t a]
+ Actual type: [t a] -> [t a]
+ • In the expression: take 5
+ In a stmt of a monad comprehension: then group using take 5
+ In the expression:
+ [x + 1 | x <- ["Hello", "World"], then group using take 5]
+ • Relevant bindings include
+ foo :: [t [Char]] (bound at mc22.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index ce3ce2d018..b576a1e380 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -1,13 +1,13 @@
-
-tcfail032.hs:14:8: error:
- • Couldn't match expected type ‘a1 -> Int’ with actual type ‘t’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature:
- Eq a1 => a1 -> Int
- at tcfail032.hs:14:8-30
- • In the expression: (x :: (Eq a) => a -> Int)
- In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
- • Relevant bindings include
- x :: t (bound at tcfail032.hs:14:3)
- f :: t -> forall a. Eq a => a -> Int (bound at tcfail032.hs:14:1)
+
+tcfail032.hs:14:8: error:
+ • Couldn't match expected type ‘a1 -> Int’ with actual type ‘t’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ Eq a1 => a1 -> Int
+ at tcfail032.hs:14:13-30
+ • In the expression: (x :: (Eq a) => a -> Int)
+ In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
+ • Relevant bindings include
+ x :: t (bound at tcfail032.hs:14:3)
+ f :: t -> forall a. Eq a => a -> Int (bound at tcfail032.hs:14:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail065.stderr b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
index 369b0807d7..e38196980d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail065.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
@@ -1,17 +1,17 @@
-
-tcfail065.hs:29:18: error:
- • Couldn't match type ‘x1’ with ‘x’
- ‘x1’ is a rigid type variable bound by
- the type signature for:
- setX :: forall x1. x1 -> X x -> X x
- at tcfail065.hs:29:3
- ‘x’ is a rigid type variable bound by
- the instance declaration at tcfail065.hs:28:10
- Expected type: X x
- Actual type: X x1
- • In the expression: X x
- In an equation for ‘setX’: setX x (X _) = X x
- In the instance declaration for ‘HasX (X x)’
- • Relevant bindings include
- x :: x1 (bound at tcfail065.hs:29:8)
- setX :: x1 -> X x -> X x (bound at tcfail065.hs:29:3)
+
+tcfail065.hs:29:18: error:
+ • Couldn't match type ‘x1’ with ‘x’
+ ‘x1’ is a rigid type variable bound by
+ the type signature for:
+ setX :: forall x1. x1 -> X x -> X x
+ at tcfail065.hs:29:3-6
+ ‘x’ is a rigid type variable bound by
+ the instance declaration at tcfail065.hs:28:10-19
+ Expected type: X x
+ Actual type: X x1
+ • In the expression: X x
+ In an equation for ‘setX’: setX x (X _) = X x
+ In the instance declaration for ‘HasX (X x)’
+ • Relevant bindings include
+ x :: x1 (bound at tcfail065.hs:29:8)
+ setX :: x1 -> X x -> X x (bound at tcfail065.hs:29:3)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail068.stderr b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
index eb42f9a33b..66e7f09064 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail068.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
@@ -1,142 +1,142 @@
-
-tcfail068.hs:14:9: error:
- • Couldn't match type ‘s1’ with ‘s’
- ‘s1’ is a rigid type variable bound by
- a type expected by the context:
- forall s1. GHC.ST.ST s1 (IndTree s a)
- at tcfail068.hs:13:9
- ‘s’ is a rigid type variable bound by
- the type signature for:
- itgen :: forall a s.
- Constructed a =>
- (Int, Int) -> a -> IndTree s a
- at tcfail068.hs:11:10
- Expected type: GHC.ST.ST s1 (IndTree s a)
- Actual type: GHC.ST.ST s1 (STArray s1 (Int, Int) a)
- • In the first argument of ‘runST’, namely
- ‘(newSTArray ((1, 1), n) x)’
- In the expression: runST (newSTArray ((1, 1), n) x)
- In an equation for ‘itgen’:
- itgen n x = runST (newSTArray ((1, 1), n) x)
- • Relevant bindings include
- itgen :: (Int, Int) -> a -> IndTree s a
- (bound at tcfail068.hs:12:1)
-
-tcfail068.hs:19:9: error:
- • Couldn't match type ‘s’ with ‘s1’
- ‘s’ is a rigid type variable bound by
- the type signature for:
- itiap :: forall a s.
- Constructed a =>
- (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:16:10
- ‘s1’ is a rigid type variable bound by
- a type expected by the context:
- forall s1. GHC.ST.ST s1 (IndTree s a)
- at tcfail068.hs:18:9
- Expected type: GHC.ST.ST s1 (IndTree s a)
- Actual type: GHC.ST.ST s (IndTree s a)
- • In the first argument of ‘runST’, namely
- ‘(readSTArray arr i
- >>= \ val -> writeSTArray arr i (f val) >> return arr)’
- In the expression:
- runST
- (readSTArray arr i
- >>= \ val -> writeSTArray arr i (f val) >> return arr)
- In an equation for ‘itiap’:
- itiap i f arr
- = runST
- (readSTArray arr i
- >>= \ val -> writeSTArray arr i (f val) >> return arr)
- • Relevant bindings include
- arr :: IndTree s a (bound at tcfail068.hs:17:11)
- itiap :: (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- (bound at tcfail068.hs:17:1)
-
-tcfail068.hs:24:36: error:
- • Couldn't match type ‘s’ with ‘s1’
- ‘s’ is a rigid type variable bound by
- the type signature for:
- itrap :: forall a s.
- Constructed a =>
- ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:23:10
- ‘s1’ is a rigid type variable bound by
- a type expected by the context:
- forall s1. GHC.ST.ST s1 (IndTree s a)
- at tcfail068.hs:24:29
- Expected type: GHC.ST.ST s1 (IndTree s a)
- Actual type: GHC.ST.ST s (IndTree s a)
- • In the first argument of ‘runST’, namely ‘(itrap' i k)’
- In the expression: runST (itrap' i k)
- In an equation for ‘itrap’:
- itrap ((i, k), (j, l)) f arr
- = runST (itrap' i k)
- where
- itrap' i k
- = if k > l then return arr else (itrapsnd i k >> itrap' i (k + 1))
- itrapsnd i k
- = if i > j then
- return arr
- else
- (readSTArray arr (i, k) >>= \ val -> ...)
- • Relevant bindings include
- itrap' :: Int -> Int -> GHC.ST.ST s (IndTree s a)
- (bound at tcfail068.hs:26:9)
- itrapsnd :: Int -> Int -> GHC.ST.ST s (IndTree s a)
- (bound at tcfail068.hs:29:9)
- arr :: IndTree s a (bound at tcfail068.hs:24:23)
- itrap :: ((Int, Int), (Int, Int))
- -> (a -> a) -> IndTree s a -> IndTree s a
- (bound at tcfail068.hs:24:1)
-
-tcfail068.hs:36:46: error:
- • Couldn't match type ‘s’ with ‘s1’
- ‘s’ is a rigid type variable bound by
- the type signature for:
- itrapstate :: forall b a c s.
- Constructed b =>
- ((Int, Int), (Int, Int))
- -> (a -> b -> (a, b))
- -> ((Int, Int) -> c -> a)
- -> (a -> c)
- -> c
- -> IndTree s b
- -> (c, IndTree s b)
- at tcfail068.hs:34:15
- ‘s1’ is a rigid type variable bound by
- a type expected by the context:
- forall s1. GHC.ST.ST s1 (c, IndTree s b)
- at tcfail068.hs:36:40
- Expected type: GHC.ST.ST s1 (c, IndTree s b)
- Actual type: GHC.ST.ST s (c, IndTree s b)
- • In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
- In the expression: runST (itrapstate' i k s)
- In an equation for ‘itrapstate’:
- itrapstate ((i, k), (j, l)) f c d s arr
- = runST (itrapstate' i k s)
- where
- itrapstate' i k s
- = if k > l then
- return (s, arr)
- else
- (itrapstatesnd i k s >>= \ (s, arr) -> ...)
- itrapstatesnd i k s
- = if i > j then
- return (s, arr)
- else
- (readSTArray arr (i, k) >>= \ val -> ...)
- • Relevant bindings include
- itrapstate' :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
- (bound at tcfail068.hs:38:9)
- itrapstatesnd :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
- (bound at tcfail068.hs:41:9)
- arr :: IndTree s b (bound at tcfail068.hs:36:34)
- itrapstate :: ((Int, Int), (Int, Int))
- -> (a -> b -> (a, b))
- -> ((Int, Int) -> c -> a)
- -> (a -> c)
- -> c
- -> IndTree s b
- -> (c, IndTree s b)
- (bound at tcfail068.hs:36:1)
+
+tcfail068.hs:14:9: error:
+ • Couldn't match type ‘s1’ with ‘s’
+ ‘s1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall s1. GHC.ST.ST s1 (IndTree s a)
+ at tcfail068.hs:(13,9)-(14,31)
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ itgen :: forall a s.
+ Constructed a =>
+ (Int, Int) -> a -> IndTree s a
+ at tcfail068.hs:11:1-55
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s1 (STArray s1 (Int, Int) a)
+ • In the first argument of ‘runST’, namely
+ ‘(newSTArray ((1, 1), n) x)’
+ In the expression: runST (newSTArray ((1, 1), n) x)
+ In an equation for ‘itgen’:
+ itgen n x = runST (newSTArray ((1, 1), n) x)
+ • Relevant bindings include
+ itgen :: (Int, Int) -> a -> IndTree s a
+ (bound at tcfail068.hs:12:1)
+
+tcfail068.hs:19:9: error:
+ • Couldn't match type ‘s’ with ‘s1’
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ itiap :: forall a s.
+ Constructed a =>
+ (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:16:1-75
+ ‘s1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall s1. GHC.ST.ST s1 (IndTree s a)
+ at tcfail068.hs:(18,9)-(21,19)
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s (IndTree s a)
+ • In the first argument of ‘runST’, namely
+ ‘(readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)’
+ In the expression:
+ runST
+ (readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)
+ In an equation for ‘itiap’:
+ itiap i f arr
+ = runST
+ (readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)
+ • Relevant bindings include
+ arr :: IndTree s a (bound at tcfail068.hs:17:11)
+ itiap :: (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+ (bound at tcfail068.hs:17:1)
+
+tcfail068.hs:24:36: error:
+ • Couldn't match type ‘s’ with ‘s1’
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ itrap :: forall a s.
+ Constructed a =>
+ ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:23:1-87
+ ‘s1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall s1. GHC.ST.ST s1 (IndTree s a)
+ at tcfail068.hs:24:29-46
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s (IndTree s a)
+ • In the first argument of ‘runST’, namely ‘(itrap' i k)’
+ In the expression: runST (itrap' i k)
+ In an equation for ‘itrap’:
+ itrap ((i, k), (j, l)) f arr
+ = runST (itrap' i k)
+ where
+ itrap' i k
+ = if k > l then return arr else (itrapsnd i k >> itrap' i (k + 1))
+ itrapsnd i k
+ = if i > j then
+ return arr
+ else
+ (readSTArray arr (i, k) >>= \ val -> ...)
+ • Relevant bindings include
+ itrap' :: Int -> Int -> GHC.ST.ST s (IndTree s a)
+ (bound at tcfail068.hs:26:9)
+ itrapsnd :: Int -> Int -> GHC.ST.ST s (IndTree s a)
+ (bound at tcfail068.hs:29:9)
+ arr :: IndTree s a (bound at tcfail068.hs:24:23)
+ itrap :: ((Int, Int), (Int, Int))
+ -> (a -> a) -> IndTree s a -> IndTree s a
+ (bound at tcfail068.hs:24:1)
+
+tcfail068.hs:36:46: error:
+ • Couldn't match type ‘s’ with ‘s1’
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ itrapstate :: forall b a c s.
+ Constructed b =>
+ ((Int, Int), (Int, Int))
+ -> (a -> b -> (a, b))
+ -> ((Int, Int) -> c -> a)
+ -> (a -> c)
+ -> c
+ -> IndTree s b
+ -> (c, IndTree s b)
+ at tcfail068.hs:(34,1)-(35,62)
+ ‘s1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall s1. GHC.ST.ST s1 (c, IndTree s b)
+ at tcfail068.hs:36:40-63
+ Expected type: GHC.ST.ST s1 (c, IndTree s b)
+ Actual type: GHC.ST.ST s (c, IndTree s b)
+ • In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
+ In the expression: runST (itrapstate' i k s)
+ In an equation for ‘itrapstate’:
+ itrapstate ((i, k), (j, l)) f c d s arr
+ = runST (itrapstate' i k s)
+ where
+ itrapstate' i k s
+ = if k > l then
+ return (s, arr)
+ else
+ (itrapstatesnd i k s >>= \ (s, arr) -> ...)
+ itrapstatesnd i k s
+ = if i > j then
+ return (s, arr)
+ else
+ (readSTArray arr (i, k) >>= \ val -> ...)
+ • Relevant bindings include
+ itrapstate' :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
+ (bound at tcfail068.hs:38:9)
+ itrapstatesnd :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
+ (bound at tcfail068.hs:41:9)
+ arr :: IndTree s b (bound at tcfail068.hs:36:34)
+ itrapstate :: ((Int, Int), (Int, Int))
+ -> (a -> b -> (a, b))
+ -> ((Int, Int) -> c -> a)
+ -> (a -> c)
+ -> c
+ -> IndTree s b
+ -> (c, IndTree s b)
+ (bound at tcfail068.hs:36:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail076.stderr b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
index 242c62235e..bee39a2c68 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail076.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
@@ -1,19 +1,19 @@
-
-tcfail076.hs:18:82: error:
- • Couldn't match type ‘res’ with ‘res1’
- ‘res’ is a rigid type variable bound by
- a type expected by the context:
- forall res. (a -> m res) -> m res
- at tcfail076.hs:18:28
- ‘res1’ is a rigid type variable bound by
- a type expected by the context:
- forall res1. (b -> m res1) -> m res1
- at tcfail076.hs:18:64
- Expected type: m res1
- Actual type: m res
- • In the expression: cont a
- In the first argument of ‘KContT’, namely ‘(\ cont' -> cont a)’
- In the expression: KContT (\ cont' -> cont a)
- • Relevant bindings include
- cont' :: b -> m res1 (bound at tcfail076.hs:18:73)
- cont :: a -> m res (bound at tcfail076.hs:18:37)
+
+tcfail076.hs:18:82: error:
+ • Couldn't match type ‘res’ with ‘res1’
+ ‘res’ is a rigid type variable bound by
+ a type expected by the context:
+ forall res. (a -> m res) -> m res
+ at tcfail076.hs:18:28-96
+ ‘res1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall res1. (b -> m res1) -> m res1
+ at tcfail076.hs:18:64-88
+ Expected type: m res1
+ Actual type: m res
+ • In the expression: cont a
+ In the first argument of ‘KContT’, namely ‘(\ cont' -> cont a)’
+ In the expression: KContT (\ cont' -> cont a)
+ • Relevant bindings include
+ cont' :: b -> m res1 (bound at tcfail076.hs:18:73)
+ cont :: a -> m res (bound at tcfail076.hs:18:37)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail103.stderr b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
index 2d76dc588a..59635a3638 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail103.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
@@ -1,24 +1,24 @@
-
-tcfail103.hs:15:13: error:
- • Couldn't match type ‘t’ with ‘s’
- ‘t’ is a rigid type variable bound by
- the type signature for:
- f :: forall t. ST t Int
- at tcfail103.hs:10:5
- ‘s’ is a rigid type variable bound by
- the type signature for:
- g :: forall s. ST s Int
- at tcfail103.hs:13:14
- Expected type: ST s Int
- Actual type: ST t Int
- • In the expression: readSTRef v
- In an equation for ‘g’: g = readSTRef v
- In the expression:
- do { v <- newSTRef 5;
- let g :: ST s Int
- g = readSTRef v;
- g }
- • Relevant bindings include
- g :: ST s Int (bound at tcfail103.hs:15:9)
- v :: STRef t Int (bound at tcfail103.hs:12:5)
- f :: ST t Int (bound at tcfail103.hs:11:1)
+
+tcfail103.hs:15:13: error:
+ • Couldn't match type ‘t’ with ‘s’
+ ‘t’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall t. ST t Int
+ at tcfail103.hs:10:1-12
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall s. ST s Int
+ at tcfail103.hs:13:9-21
+ Expected type: ST s Int
+ Actual type: ST t Int
+ • In the expression: readSTRef v
+ In an equation for ‘g’: g = readSTRef v
+ In the expression:
+ do { v <- newSTRef 5;
+ let g :: ST s Int
+ g = readSTRef v;
+ g }
+ • Relevant bindings include
+ g :: ST s Int (bound at tcfail103.hs:15:9)
+ v :: STRef t Int (bound at tcfail103.hs:12:5)
+ f :: ST t Int (bound at tcfail103.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail131.stderr b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
index 2ae70a0928..e9920ea55e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail131.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
@@ -1,13 +1,13 @@
-
-tcfail131.hs:7:11: error:
- • Couldn't match expected type ‘Integer’ with actual type ‘b’
- ‘b’ is a rigid type variable bound by
- the type signature for:
- g :: forall b. Num b => b -> b
- at tcfail131.hs:6:8
- • In the first argument of ‘f’, namely ‘x’
- In the expression: f x x
- In an equation for ‘g’: g x = f x x
- • Relevant bindings include
- x :: b (bound at tcfail131.hs:7:5)
- g :: b -> b (bound at tcfail131.hs:7:3)
+
+tcfail131.hs:7:11: error:
+ • Couldn't match expected type ‘Integer’ with actual type ‘b’
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall b. Num b => b -> b
+ at tcfail131.hs:6:3-22
+ • In the first argument of ‘f’, namely ‘x’
+ In the expression: f x x
+ In an equation for ‘g’: g x = f x x
+ • Relevant bindings include
+ x :: b (bound at tcfail131.hs:7:5)
+ g :: b -> b (bound at tcfail131.hs:7:3)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail153.stderr b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
index 5f4ec3e013..e80add6e90 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail153.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
@@ -1,17 +1,17 @@
-
-tcfail153.hs:6:9: error:
- • Couldn't match expected type ‘Bool’ with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a. a -> [a]
- at tcfail153.hs:5:6
- • In the first argument of ‘g’, namely ‘x’
- In the expression: g x
- In an equation for ‘f’:
- f x
- = g x
- where
- g y = if y then [] else [...]
- • Relevant bindings include
- x :: a (bound at tcfail153.hs:6:3)
- f :: a -> [a] (bound at tcfail153.hs:6:1)
+
+tcfail153.hs:6:9: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> [a]
+ at tcfail153.hs:5:1-13
+ • In the first argument of ‘g’, namely ‘x’
+ In the expression: g x
+ In an equation for ‘f’:
+ f x
+ = g x
+ where
+ g y = if y then [] else [...]
+ • Relevant bindings include
+ x :: a (bound at tcfail153.hs:6:3)
+ f :: a -> [a] (bound at tcfail153.hs:6:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index 9c473e9884..66a057bd9b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ -1,30 +1,30 @@
-
-tcfail174.hs:14:14: error:
- • Couldn't match type ‘a’ with ‘a1’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type a1 -> a1
- at tcfail174.hs:14:1-14
- Expected type: Capture (forall x. x -> a)
- Actual type: Capture (forall a. a -> a)
- • In the first argument of ‘Capture’, namely ‘g’
- In the expression: Capture g
- In an equation for ‘h1’: h1 = Capture g
- • Relevant bindings include
- h1 :: Capture a (bound at tcfail174.hs:14:1)
-
-tcfail174.hs:17:14: error:
- • Couldn't match type ‘a’ with ‘b’
- ‘a’ is a rigid type variable bound by
- the type a -> a at tcfail174.hs:1:1
- ‘b’ is a rigid type variable bound by
- the type signature for:
- h2 :: forall b. Capture b
- at tcfail174.hs:16:7
- Expected type: Capture (forall x. x -> b)
- Actual type: Capture (forall a. a -> a)
- • In the first argument of ‘Capture’, namely ‘g’
- In the expression: Capture g
- In an equation for ‘h2’: h2 = Capture g
- • Relevant bindings include
- h2 :: Capture b (bound at tcfail174.hs:17:1)
+
+tcfail174.hs:14:14: error:
+ • Couldn't match type ‘a’ with ‘a1’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type a1 -> a1
+ at tcfail174.hs:14:1-14
+ Expected type: Capture (forall x. x -> a)
+ Actual type: Capture (forall a. a -> a)
+ • In the first argument of ‘Capture’, namely ‘g’
+ In the expression: Capture g
+ In an equation for ‘h1’: h1 = Capture g
+ • Relevant bindings include
+ h1 :: Capture a (bound at tcfail174.hs:14:1)
+
+tcfail174.hs:17:14: error:
+ • Couldn't match type ‘a’ with ‘b’
+ ‘a’ is a rigid type variable bound by
+ the type a -> a at tcfail174.hs:1:1
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ h2 :: forall b. Capture b
+ at tcfail174.hs:16:1-15
+ Expected type: Capture (forall x. x -> b)
+ Actual type: Capture (forall a. a -> a)
+ • In the first argument of ‘Capture’, namely ‘g’
+ In the expression: Capture g
+ In an equation for ‘h2’: h2 = Capture g
+ • Relevant bindings include
+ h2 :: Capture b (bound at tcfail174.hs:17:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail175.stderr b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
index c421684b8d..b55203de3f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail175.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
@@ -1,12 +1,12 @@
-
-tcfail175.hs:11:1: error:
- • Couldn't match expected type ‘a’
- with actual type ‘String -> String -> String’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- evalRHS :: forall a. Int -> a
- at tcfail175.hs:10:12
- • The equation(s) for ‘evalRHS’ have three arguments,
- but its type ‘Int -> a’ has only one
- • Relevant bindings include
- evalRHS :: Int -> a (bound at tcfail175.hs:11:1)
+
+tcfail175.hs:11:1: error:
+ • Couldn't match expected type ‘a’
+ with actual type ‘String -> String -> String’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ evalRHS :: forall a. Int -> a
+ at tcfail175.hs:10:1-19
+ • The equation(s) for ‘evalRHS’ have three arguments,
+ but its type ‘Int -> a’ has only one
+ • Relevant bindings include
+ evalRHS :: Int -> a (bound at tcfail175.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail179.stderr b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
index 2a0a5bf614..cb01a3c483 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail179.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
@@ -1,22 +1,22 @@
-
-tcfail179.hs:14:41: error:
- • Couldn't match type ‘x’ with ‘s’
- ‘x’ is a rigid type variable bound by
- a pattern with constructor:
- T :: forall s x. (s -> (x -> s) -> (x, s, Int)) -> T s,
- in a case alternative
- at tcfail179.hs:14:14
- ‘s’ is a rigid type variable bound by
- the type signature for:
- run :: forall s. T s -> Int
- at tcfail179.hs:12:8
- Expected type: x -> s
- Actual type: s -> s
- • In the second argument of ‘g’, namely ‘id’
- In the expression: g x id
- In a pattern binding: (x, _, b) = g x id
- • Relevant bindings include
- x :: s (bound at tcfail179.hs:14:26)
- g :: s -> (x -> s) -> (x, s, Int) (bound at tcfail179.hs:14:16)
- ts :: T s (bound at tcfail179.hs:13:5)
- run :: T s -> Int (bound at tcfail179.hs:13:1)
+
+tcfail179.hs:14:41: error:
+ • Couldn't match type ‘x’ with ‘s’
+ ‘x’ is a rigid type variable bound by
+ a pattern with constructor:
+ T :: forall s x. (s -> (x -> s) -> (x, s, Int)) -> T s,
+ in a case alternative
+ at tcfail179.hs:14:14-16
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ run :: forall s. T s -> Int
+ at tcfail179.hs:12:1-17
+ Expected type: x -> s
+ Actual type: s -> s
+ • In the second argument of ‘g’, namely ‘id’
+ In the expression: g x id
+ In a pattern binding: (x, _, b) = g x id
+ • Relevant bindings include
+ x :: s (bound at tcfail179.hs:14:26)
+ g :: s -> (x -> s) -> (x, s, Int) (bound at tcfail179.hs:14:16)
+ ts :: T s (bound at tcfail179.hs:13:5)
+ run :: T s -> Int (bound at tcfail179.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail191.stderr b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
index 6b338eb5ed..fe831aeae2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail191.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
@@ -1,13 +1,13 @@
-
-tcfail191.hs:11:26: error:
- • Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [[a]]
- at tcfail191.hs:10:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- • In the expression: take 5
- In a stmt of a list comprehension: then group using take 5
- In the expression:
- [() | x <- [Gnorf, Brain], then group using take 5]
+
+tcfail191.hs:11:26: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at tcfail191.hs:(10,9)-(11,31)
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ • In the expression: take 5
+ In a stmt of a list comprehension: then group using take 5
+ In the expression:
+ [() | x <- [Gnorf, Brain], then group using take 5]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail193.stderr b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
index 4a96fa4aef..0e24649578 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail193.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
@@ -1,12 +1,12 @@
-
-tcfail193.hs:10:31: error:
- • Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [a]
- at tcfail193.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- • In the expression: inits
- In a stmt of a list comprehension: then inits
- In the expression: [x | x <- [3, 2, 1], then inits]
+
+tcfail193.hs:10:31: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at tcfail193.hs:10:10-35
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ • In the expression: inits
+ In a stmt of a list comprehension: then inits
+ In the expression: [x | x <- [3, 2, 1], then inits]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail198.stderr b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
index 56b1b70670..f073b5e66e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail198.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
@@ -5,7 +5,7 @@ tcfail198.hs:6:36: error:
This (rigid, skolem) type variable is bound by
an expression type signature:
a1
- at tcfail198.hs:6:36-41
+ at tcfail198.hs:6:41
• In the expression: x :: a
In the second argument of ‘(++)’, namely ‘[x :: a]’
In the expression: xs ++ [x :: a]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index b142cb18bd..9df11cafff 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -1,19 +1,19 @@
-
-tcfail201.hs:17:56: error:
- • Couldn't match type ‘a’ with ‘HsDoc t0’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- gfoldl' :: forall (c :: * -> *) a.
- (forall a1 b. c (a1 -> b) -> a1 -> c b)
- -> (forall g. g -> c g) -> a -> c a
- at tcfail201.hs:15:12
- Expected type: c a
- Actual type: c (HsDoc t0)
- • In the expression: z DocEmpty
- In a case alternative: DocEmpty -> z DocEmpty
- In the expression: case hsDoc of { DocEmpty -> z DocEmpty }
- • Relevant bindings include
- hsDoc :: a (bound at tcfail201.hs:16:13)
- gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
- -> (forall g. g -> c g) -> a -> c a
- (bound at tcfail201.hs:16:1)
+
+tcfail201.hs:17:56: error:
+ • Couldn't match type ‘a’ with ‘HsDoc t0’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ gfoldl' :: forall (c :: * -> *) a.
+ (forall a1 b. c (a1 -> b) -> a1 -> c b)
+ -> (forall g. g -> c g) -> a -> c a
+ at tcfail201.hs:15:1-85
+ Expected type: c a
+ Actual type: c (HsDoc t0)
+ • In the expression: z DocEmpty
+ In a case alternative: DocEmpty -> z DocEmpty
+ In the expression: case hsDoc of { DocEmpty -> z DocEmpty }
+ • Relevant bindings include
+ hsDoc :: a (bound at tcfail201.hs:16:13)
+ gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
+ -> (forall g. g -> c g) -> a -> c a
+ (bound at tcfail201.hs:16:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail206.stderr b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
index e60856aaf9..3eb7bfc029 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail206.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
@@ -1,55 +1,55 @@
-
-tcfail206.hs:5:5: error:
- • Couldn't match type ‘Bool’ with ‘Int’
- Expected type: Bool -> (Int, Bool)
- Actual type: Int -> (Int, Bool)
- • In the expression: (, True)
- In an equation for ‘a’: a = (, True)
-
-tcfail206.hs:8:5: error:
- • Couldn't match type ‘(Integer, Int)’ with ‘Bool -> (Int, Bool)’
- Expected type: Int -> Bool -> (Int, Bool)
- Actual type: Int -> (Integer, Int)
- • In the expression: (1,)
- In an equation for ‘b’: b = (1,)
-
-tcfail206.hs:11:5: error:
- • Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- c :: forall a. a -> (a, Bool)
- at tcfail206.hs:10:6
- Expected type: a -> (a, Bool)
- Actual type: Bool -> (a, Bool)
- • In the expression: (True || False,)
- In an equation for ‘c’: c = (True || False,)
- • Relevant bindings include
- c :: a -> (a, Bool) (bound at tcfail206.hs:11:1)
-
-tcfail206.hs:14:5: error:
- • Couldn't match type ‘Bool’ with ‘Int’
- Expected type: Bool -> (# Int, Bool #)
- Actual type: Int -> (# Int, Bool #)
- • In the expression: (# , True #)
- In an equation for ‘d’: d = (# , True #)
-
-tcfail206.hs:17:5: error:
- • Couldn't match type ‘(# Integer, Int #)’
- with ‘Bool -> (# Int, Bool #)’
- Expected type: Int -> Bool -> (# Int, Bool #)
- Actual type: Int -> (# Integer, Int #)
- • In the expression: (# 1, #)
- In an equation for ‘e’: e = (# 1, #)
-
-tcfail206.hs:20:5: error:
- • Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a. a -> (# a, Bool #)
- at tcfail206.hs:19:6
- Expected type: a -> (# a, Bool #)
- Actual type: Bool -> (# a, Bool #)
- • In the expression: (# True || False, #)
- In an equation for ‘f’: f = (# True || False, #)
- • Relevant bindings include
- f :: a -> (# a, Bool #) (bound at tcfail206.hs:20:1)
+
+tcfail206.hs:5:5: error:
+ • Couldn't match type ‘Bool’ with ‘Int’
+ Expected type: Bool -> (Int, Bool)
+ Actual type: Int -> (Int, Bool)
+ • In the expression: (, True)
+ In an equation for ‘a’: a = (, True)
+
+tcfail206.hs:8:5: error:
+ • Couldn't match type ‘(Integer, Int)’ with ‘Bool -> (Int, Bool)’
+ Expected type: Int -> Bool -> (Int, Bool)
+ Actual type: Int -> (Integer, Int)
+ • In the expression: (1,)
+ In an equation for ‘b’: b = (1,)
+
+tcfail206.hs:11:5: error:
+ • Couldn't match type ‘a’ with ‘Bool’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ c :: forall a. a -> (a, Bool)
+ at tcfail206.hs:10:1-19
+ Expected type: a -> (a, Bool)
+ Actual type: Bool -> (a, Bool)
+ • In the expression: (True || False,)
+ In an equation for ‘c’: c = (True || False,)
+ • Relevant bindings include
+ c :: a -> (a, Bool) (bound at tcfail206.hs:11:1)
+
+tcfail206.hs:14:5: error:
+ • Couldn't match type ‘Bool’ with ‘Int’
+ Expected type: Bool -> (# Int, Bool #)
+ Actual type: Int -> (# Int, Bool #)
+ • In the expression: (# , True #)
+ In an equation for ‘d’: d = (# , True #)
+
+tcfail206.hs:17:5: error:
+ • Couldn't match type ‘(# Integer, Int #)’
+ with ‘Bool -> (# Int, Bool #)’
+ Expected type: Int -> Bool -> (# Int, Bool #)
+ Actual type: Int -> (# Integer, Int #)
+ • In the expression: (# 1, #)
+ In an equation for ‘e’: e = (# 1, #)
+
+tcfail206.hs:20:5: error:
+ • Couldn't match type ‘a’ with ‘Bool’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> (# a, Bool #)
+ at tcfail206.hs:19:1-21
+ Expected type: a -> (# a, Bool #)
+ Actual type: Bool -> (# a, Bool #)
+ • In the expression: (# True || False, #)
+ In an equation for ‘f’: f = (# True || False, #)
+ • Relevant bindings include
+ f :: a -> (# a, Bool #) (bound at tcfail206.hs:20:1)