summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/dependent/should_fail/RAE_T32a.stderr3
-rw-r--r--testsuite/tests/dependent/should_fail/T11407.stderr8
-rw-r--r--testsuite/tests/dependent/should_fail/T13780a.stderr3
-rw-r--r--testsuite/tests/dependent/should_fail/T14066e.stderr6
-rw-r--r--testsuite/tests/dependent/should_fail/T15859.hs6
-rw-r--r--testsuite/tests/dependent/should_fail/T15859.stderr10
-rw-r--r--testsuite/tests/dependent/should_fail/T15859a.hs19
-rw-r--r--testsuite/tests/dependent/should_fail/T15859a.stderr6
-rw-r--r--testsuite/tests/dependent/should_fail/T16344a.stderr3
-rw-r--r--testsuite/tests/dependent/should_fail/all.T1
-rw-r--r--testsuite/tests/gadt/T12468.stderr3
-rw-r--r--testsuite/tests/gadt/gadt-escape1.stderr11
-rw-r--r--testsuite/tests/gadt/gadt13.stderr12
-rw-r--r--testsuite/tests/gadt/gadt7.stderr17
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T14628.stderr4
-rw-r--r--testsuite/tests/ghci/scripts/T10249.stderr3
-rw-r--r--testsuite/tests/ghci/scripts/T8353.stderr15
-rw-r--r--testsuite/tests/ghci/should_run/T15007.stderr3
-rw-r--r--testsuite/tests/impredicative/boxy.hs10
-rw-r--r--testsuite/tests/indexed-types/should_fail/T14887.stderr9
-rw-r--r--testsuite/tests/indexed-types/should_fail/T15870.stderr3
-rw-r--r--testsuite/tests/indexed-types/should_fail/T5439.stderr3
-rw-r--r--testsuite/tests/indexed-types/should_fail/T7354.stderr3
-rw-r--r--testsuite/tests/linear/should_fail/LinearConfusedDollar.stderr8
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr3
-rw-r--r--testsuite/tests/parser/should_fail/readFail003.stderr6
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T14584.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T14584a.stderr17
-rw-r--r--testsuite/tests/patsyn/should_fail/T15685.stderr22
-rw-r--r--testsuite/tests/patsyn/should_fail/T15694.stderr5
-rw-r--r--testsuite/tests/patsyn/should_fail/T15695.stderr2
-rw-r--r--testsuite/tests/plugins/test-hole-plugin.stderr15
-rw-r--r--testsuite/tests/polykinds/T11520.stderr3
-rw-r--r--testsuite/tests/polykinds/T12593.stderr9
-rw-r--r--testsuite/tests/polykinds/T14172.hs5
-rw-r--r--testsuite/tests/polykinds/T14172.stderr4
-rw-r--r--testsuite/tests/polykinds/T14846.stderr14
-rw-r--r--testsuite/tests/polykinds/T15787.stderr3
-rw-r--r--testsuite/tests/polykinds/T16221a.stderr8
-rw-r--r--testsuite/tests/polykinds/T16245a.hs10
-rw-r--r--testsuite/tests/polykinds/T16245a.stderr12
-rw-r--r--testsuite/tests/polykinds/T16902.stderr3
-rw-r--r--testsuite/tests/polykinds/T17841.stderr4
-rw-r--r--testsuite/tests/polykinds/T17963.stderr6
-rw-r--r--testsuite/tests/polykinds/T7438.stderr19
-rw-r--r--testsuite/tests/polykinds/T7594.stderr11
-rw-r--r--testsuite/tests/polykinds/T7805.stderr4
-rw-r--r--testsuite/tests/polykinds/T8616.stderr14
-rw-r--r--testsuite/tests/polykinds/T9017.stderr9
-rw-r--r--testsuite/tests/polykinds/TyVarTvKinds3.stderr6
-rw-r--r--testsuite/tests/polykinds/all.T1
-rw-r--r--testsuite/tests/saks/should_fail/saks_fail019.stderr3
-rw-r--r--testsuite/tests/simplCore/should_compile/simpl017.stderr44
-rw-r--r--testsuite/tests/th/T10267.stderr6
-rw-r--r--testsuite/tests/th/T15321.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/PolytypeDecomp.hs22
-rw-r--r--testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr20
-rw-r--r--testsuite/tests/typecheck/should_compile/T10971a.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/T13050.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/T9404b.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/T9497a.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T4
-rw-r--r--testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/hole_constraints.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/hole_constraints_nested.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/holes.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/holes3.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/local_hole_fits.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/tc211.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc211.stderr17
-rw-r--r--testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr9
-rw-r--r--testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr27
-rw-r--r--testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T12177.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T14884.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T14904a.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/T15799.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T15807.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/T15862.stderr33
-rw-r--r--testsuite/tests/typecheck/should_fail/T15962.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T16456.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T17773.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640a.hs11
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640a.stderr9
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640b.hs14
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640b.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640c.hs14
-rw-r--r--testsuite/tests/typecheck/should_fail/T18640c.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T2846b.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T2846b.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/T5570.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T6069.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7734.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T8450.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T8570.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T8603.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T9109.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T9497d.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T9858e.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail002.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail014.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail033.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail140.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail165.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.hs8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail204.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail218.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/too-many.hs18
-rw-r--r--testsuite/tests/typecheck/should_fail/too-many.stderr16
-rw-r--r--testsuite/tests/typecheck/should_run/T9497a-run.stderr3
-rw-r--r--testsuite/tests/typecheck/should_run/T9497b-run.stderr3
-rw-r--r--testsuite/tests/typecheck/should_run/T9497c-run.stderr3
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun042.hs3
-rw-r--r--testsuite/tests/warnings/should_compile/PluralS.stderr2
124 files changed, 592 insertions, 414 deletions
diff --git a/testsuite/tests/dependent/should_fail/RAE_T32a.stderr b/testsuite/tests/dependent/should_fail/RAE_T32a.stderr
index 41f5d7cd4c..90c3cd671a 100644
--- a/testsuite/tests/dependent/should_fail/RAE_T32a.stderr
+++ b/testsuite/tests/dependent/should_fail/RAE_T32a.stderr
@@ -1,7 +1,6 @@
RAE_T32a.hs:29:1: error:
- • Expected kind ‘k0 -> *’,
- but ‘Sing Sigma (Sigma p r)’ has kind ‘*’
+ • Expected kind ‘k -> *’, but ‘Sing Sigma (Sigma p r)’ has kind ‘*’
• In the data instance declaration for ‘Sing’
RAE_T32a.hs:29:20: error:
diff --git a/testsuite/tests/dependent/should_fail/T11407.stderr b/testsuite/tests/dependent/should_fail/T11407.stderr
index df87248f2e..b24559ea9a 100644
--- a/testsuite/tests/dependent/should_fail/T11407.stderr
+++ b/testsuite/tests/dependent/should_fail/T11407.stderr
@@ -1,8 +1,8 @@
T11407.hs:10:40: error:
- • Expected kind ‘x a’, but ‘a’ has kind ‘k0’
+ • Expected kind ‘x a’, but ‘a’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
+ a family instance declaration
+ at T11407.hs:10:1-72
• In the second argument of ‘UhOh’, namely ‘(a :: x a)’
In the data instance declaration for ‘UhOh’
- • Type variable kinds:
- x :: k0 -> *
- a :: k0
diff --git a/testsuite/tests/dependent/should_fail/T13780a.stderr b/testsuite/tests/dependent/should_fail/T13780a.stderr
index 5253ed0dbd..6cdcf96369 100644
--- a/testsuite/tests/dependent/should_fail/T13780a.stderr
+++ b/testsuite/tests/dependent/should_fail/T13780a.stderr
@@ -2,6 +2,9 @@
T13780a.hs:9:40: error:
• Couldn't match kind ‘a’ with ‘Bool’
Expected kind ‘Foo a’, but ‘MkFoo’ has kind ‘Foo Bool’
+ ‘a’ is a rigid type variable bound by
+ a family instance declaration
+ at T13780a.hs:9:20-31
• In the second argument of ‘(~)’, namely ‘MkFoo’
In the definition of data constructor ‘SMkFoo’
In the data instance declaration for ‘Sing’
diff --git a/testsuite/tests/dependent/should_fail/T14066e.stderr b/testsuite/tests/dependent/should_fail/T14066e.stderr
index b103b16187..caa062e392 100644
--- a/testsuite/tests/dependent/should_fail/T14066e.stderr
+++ b/testsuite/tests/dependent/should_fail/T14066e.stderr
@@ -1,9 +1,9 @@
T14066e.hs:13:65: error:
- • Expected a type, but ‘c'’ has kind ‘k1’
- ‘k1’ is a rigid type variable bound by
+ • Expected a type, but ‘c'’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
the type signature for:
- j :: forall {k1} {k2} (c :: k1) (b :: k2).
+ j :: forall {k} {k1} (c :: k) (b :: k1).
Proxy a -> Proxy b -> Proxy c -> Proxy b
at T14066e.hs:12:5-61
• In the kind ‘c'’
diff --git a/testsuite/tests/dependent/should_fail/T15859.hs b/testsuite/tests/dependent/should_fail/T15859.hs
index e7adc5fc98..1f9fafaee4 100644
--- a/testsuite/tests/dependent/should_fail/T15859.hs
+++ b/testsuite/tests/dependent/should_fail/T15859.hs
@@ -1,14 +1,10 @@
{-# Language PolyKinds #-}
{-# Language TypeApplications #-}
-{-# Language ImpredicativeTypes #-}
{-# Language LiberalTypeSynonyms #-}
module T15859 where
import Data.Kind
-data A k :: k -> Type
+a = (undefined :: forall k -> k -> Type) @Int
-type KindOf (a :: k) = k
-
-a = (undefined :: KindOf A) @Int
diff --git a/testsuite/tests/dependent/should_fail/T15859.stderr b/testsuite/tests/dependent/should_fail/T15859.stderr
index ec0e091055..be25e98708 100644
--- a/testsuite/tests/dependent/should_fail/T15859.stderr
+++ b/testsuite/tests/dependent/should_fail/T15859.stderr
@@ -1,8 +1,8 @@
-T15859.hs:14:19: error:
+T15859.hs:9:19: error:
• Illegal visible, dependent quantification in the type of a term:
- forall k -> k -> *
+ forall k -> k -> *
(GHC does not yet support this)
- • In the expansion of type synonym ‘KindOf’
- In an expression type signature: KindOf A
- In the expression: undefined :: KindOf A
+ • In an expression type signature: forall k -> k -> Type
+ In the expression: undefined :: forall k -> k -> Type
+ In the expression: (undefined :: forall k -> k -> Type) @Int
diff --git a/testsuite/tests/dependent/should_fail/T15859a.hs b/testsuite/tests/dependent/should_fail/T15859a.hs
new file mode 100644
index 0000000000..e76b298e85
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T15859a.hs
@@ -0,0 +1,19 @@
+{-# Language PolyKinds #-}
+{-# Language TypeApplications #-}
+{-# Language LiberalTypeSynonyms #-}
+
+module T15859 where
+
+import Data.Kind
+
+-- A :: forall (k :: Type) -> k -> Type
+data A k :: k -> Type
+
+-- KindOf :: forall (k::Type). k -> Type
+type KindOf (a :: k) = k
+
+-- This variant requires impredicative instantiation of KindOf
+-- KindOf @(forall k -> k -> Type) A
+-- which GHC does not (yet) support at the kind level, even
+-- with Quick Look
+a = (undefined :: KindOf A) @Int
diff --git a/testsuite/tests/dependent/should_fail/T15859a.stderr b/testsuite/tests/dependent/should_fail/T15859a.stderr
new file mode 100644
index 0000000000..1fdac765f2
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T15859a.stderr
@@ -0,0 +1,6 @@
+
+T15859a.hs:19:5: error:
+ • Cannot apply expression of type ‘KindOf A’
+ to a visible type argument ‘Int’
+ • In the expression: (undefined :: KindOf A) @Int
+ In an equation for ‘a’: a = (undefined :: KindOf A) @Int
diff --git a/testsuite/tests/dependent/should_fail/T16344a.stderr b/testsuite/tests/dependent/should_fail/T16344a.stderr
index d838d14e57..8325bf4169 100644
--- a/testsuite/tests/dependent/should_fail/T16344a.stderr
+++ b/testsuite/tests/dependent/should_fail/T16344a.stderr
@@ -1,6 +1,9 @@
T16344a.hs:11:36: error:
• Expected a type, but ‘a’ has kind ‘ka’
+ ‘ka’ is a rigid type variable bound by
+ the data constructor ‘MkT2’
+ at T16344a.hs:11:9-10
• In the second argument of ‘T2’, namely ‘a’
In the type ‘(T2 Type a)’
In the definition of data constructor ‘MkT2’
diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T
index af95d1b333..e8705af1e5 100644
--- a/testsuite/tests/dependent/should_fail/all.T
+++ b/testsuite/tests/dependent/should_fail/all.T
@@ -39,6 +39,7 @@ test('T15743c', normal, compile_fail, [''])
test('T15743d', normal, compile_fail, [''])
test('T15825', normal, compile_fail, [''])
test('T15859', normal, compile_fail, [''])
+test('T15859a', normal, compile_fail, [''])
test('T15264', normal, compile_fail, [''])
test('T16326_Fail1', normal, compile_fail, [''])
test('T16326_Fail2', normal, compile_fail, [''])
diff --git a/testsuite/tests/gadt/T12468.stderr b/testsuite/tests/gadt/T12468.stderr
index 402a93d82d..5abe870814 100644
--- a/testsuite/tests/gadt/T12468.stderr
+++ b/testsuite/tests/gadt/T12468.stderr
@@ -1,8 +1,7 @@
T12468.hs:9:7: error:
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f I = _
+ • In an equation for ‘f’: f I = _
• Relevant bindings include f :: T a -> a (bound at T12468.hs:9:1)
Constraints include a ~ Int (from T12468.hs:9:3)
Valid hole fits include
diff --git a/testsuite/tests/gadt/gadt-escape1.stderr b/testsuite/tests/gadt/gadt-escape1.stderr
index 19aa501a4c..d771c63828 100644
--- a/testsuite/tests/gadt/gadt-escape1.stderr
+++ b/testsuite/tests/gadt/gadt-escape1.stderr
@@ -1,13 +1,12 @@
gadt-escape1.hs:19:58: error:
- • Couldn't match type ‘p’ with ‘ExpGADT Int’
+ • Could not deduce: p ~ ExpGADT Int
+ from the context: t ~ Int
+ bound by a pattern with constructor: ExpInt :: Int -> ExpGADT Int,
+ in a case alternative
+ at gadt-escape1.hs:19:43-50
Expected: p
Actual: ExpGADT t
- ‘p’ is untouchable
- inside the constraints: t ~ Int
- bound by a pattern with constructor: ExpInt :: Int -> ExpGADT Int,
- in a case alternative
- at gadt-escape1.hs:19:43-50
‘p’ is a rigid type variable bound by
the inferred type of weird1 :: p
at gadt-escape1.hs:19:1-58
diff --git a/testsuite/tests/gadt/gadt13.stderr b/testsuite/tests/gadt/gadt13.stderr
index cea221944b..49eb2bc96f 100644
--- a/testsuite/tests/gadt/gadt13.stderr
+++ b/testsuite/tests/gadt/gadt13.stderr
@@ -1,12 +1,10 @@
gadt13.hs:15:13: error:
- • Couldn't match expected type ‘p’
- with actual type ‘String -> [Char]’
- ‘p’ is untouchable
- inside the constraints: a ~ Int
- bound by a pattern with constructor: I :: Int -> Term Int,
- in an equation for ‘shw’
- at gadt13.hs:15:6-8
+ • Could not deduce: p ~ (String -> [Char])
+ from the context: a ~ Int
+ bound by a pattern with constructor: I :: Int -> Term Int,
+ in an equation for ‘shw’
+ at gadt13.hs:15:6-8
‘p’ is a rigid type variable bound by
the inferred type of shw :: Term a -> p
at gadt13.hs:15:1-30
diff --git a/testsuite/tests/gadt/gadt7.stderr b/testsuite/tests/gadt/gadt7.stderr
index bb179975fb..679ec3b00e 100644
--- a/testsuite/tests/gadt/gadt7.stderr
+++ b/testsuite/tests/gadt/gadt7.stderr
@@ -1,15 +1,16 @@
gadt7.hs:16:38: error:
- • Couldn't match expected type ‘p1’ with actual type ‘p’
- ‘p’ is untouchable
- inside the constraints: a ~ Int
- bound by a pattern with constructor: K :: T Int,
- in a case alternative
- at gadt7.hs:16:33
+ • Could not deduce: p ~ p1
+ from the context: a ~ Int
+ bound by a pattern with constructor: K :: T Int,
+ in a case alternative
+ at gadt7.hs:16:33
‘p’ is a rigid type variable bound by
- the inferred type of i1b :: T a -> p -> p1 at gadt7.hs:16:1-44
+ the inferred type of i1b :: T a -> p -> p1
+ at gadt7.hs:16:1-44
‘p1’ is a rigid type variable bound by
- the inferred type of i1b :: T a -> p -> p1 at gadt7.hs:16:1-44
+ the inferred type of i1b :: T a -> p -> p1
+ at gadt7.hs:16:1-44
Possible fix: add a type signature for ‘i1b’
• In the expression: y1
In a case alternative: K -> y1
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.stderr b/testsuite/tests/ghci.debugger/scripts/T14628.stderr
index 8990cdb97b..fbce771874 100644
--- a/testsuite/tests/ghci.debugger/scripts/T14628.stderr
+++ b/testsuite/tests/ghci.debugger/scripts/T14628.stderr
@@ -3,10 +3,6 @@
• Couldn't match type ‘m’ with ‘(,) a0’
Expected: (a0, ((), Int))
Actual: m ((), Int)
- ‘m’ is untouchable
- inside the constraints: ()
- bound by the inferred type of it :: ((), Int)
- at <interactive>:4:1-25
‘m’ is an interactive-debugger skolem
• In the second argument of ‘($)’, namely ‘runStateT _result 0’
In the expression: snd $ runStateT _result 0
diff --git a/testsuite/tests/ghci/scripts/T10249.stderr b/testsuite/tests/ghci/scripts/T10249.stderr
index c8215663a5..b15f205ebb 100644
--- a/testsuite/tests/ghci/scripts/T10249.stderr
+++ b/testsuite/tests/ghci/scripts/T10249.stderr
@@ -4,6 +4,5 @@
Where: ‘t’ is a rigid type variable bound by
the inferred type of it :: t
at <interactive>:1:1
- • In the expression: _
- In an equation for ‘it’: it = _
+ • In an equation for ‘it’: it = _
• Relevant bindings include it :: t (bound at <interactive>:1:1)
diff --git a/testsuite/tests/ghci/scripts/T8353.stderr b/testsuite/tests/ghci/scripts/T8353.stderr
index a84b0b7e83..bf737eb3fb 100644
--- a/testsuite/tests/ghci/scripts/T8353.stderr
+++ b/testsuite/tests/ghci/scripts/T8353.stderr
@@ -6,8 +6,7 @@ Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
Defer03.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
f :: Int (bound at Defer03.hs:7:1)
@@ -28,8 +27,7 @@ Defer03.hs:4:5: error:
Defer03.hs:7:5: error:
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
f :: Int (bound at Defer03.hs:7:1)
@@ -50,8 +48,7 @@ Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
Defer03.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
f :: Int (bound at Defer03.hs:7:1)
@@ -72,8 +69,7 @@ Defer03.hs:4:5: error:
Defer03.hs:7:5: error:
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
f :: Int (bound at Defer03.hs:7:1)
@@ -94,8 +90,7 @@ Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
Defer03.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
f :: Int (bound at Defer03.hs:7:1)
diff --git a/testsuite/tests/ghci/should_run/T15007.stderr b/testsuite/tests/ghci/should_run/T15007.stderr
index da1dc5d1ed..e6a98b0bcb 100644
--- a/testsuite/tests/ghci/should_run/T15007.stderr
+++ b/testsuite/tests/ghci/should_run/T15007.stderr
@@ -4,6 +4,5 @@
Where: ‘t’ is a rigid type variable bound by
the inferred type of it :: t
at <interactive>:3:1
- • In the expression: _
- In an equation for ‘it’: it = _
+ • In an equation for ‘it’: it = _
• Relevant bindings include it :: t (bound at <interactive>:3:1)
diff --git a/testsuite/tests/impredicative/boxy.hs b/testsuite/tests/impredicative/boxy.hs
index 475b5c1c5e..ec42d38fa5 100644
--- a/testsuite/tests/impredicative/boxy.hs
+++ b/testsuite/tests/impredicative/boxy.hs
@@ -29,6 +29,9 @@ t2 = sing id
t3 :: forall a. a -> a
t3 = head ids
+t4 :: forall b. (forall a. a->a, b->b)
+t4 = (id, id)
+
{--------------- Examples from QMLF paper -------------------}
qF :: (forall a. a -> a -> a) -> (Bool, Char)
@@ -46,8 +49,11 @@ choose x y = x
impred1 :: (Bool, Char)
impred1 = ($) qF choose --- impredicative instantiation for $
-impred2 :: (forall a. a -> a -> a) -> (Bool, Char)
-impred2 = id qF
+impred2 :: (Bool, Char)
+impred2 = qF $ choose --- impredicative instantiation for $
+
+impred3 :: (forall a. a -> a -> a) -> (Bool, Char)
+impred3 = id qF
{------ Examples for Garrique/Remy paper -------}
diff --git a/testsuite/tests/indexed-types/should_fail/T14887.stderr b/testsuite/tests/indexed-types/should_fail/T14887.stderr
index ff7e14b464..6b5c57977e 100644
--- a/testsuite/tests/indexed-types/should_fail/T14887.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T14887.stderr
@@ -5,12 +5,3 @@ T14887.hs:13:1: error:
NB: Specified variables (namely: (a :: k)) always come first
Perhaps try this order instead: k (a :: k) (e :: a :~: a)
• In the type family declaration for ‘Foo2’
-
-T14887.hs:14:11: error:
- • Couldn't match kind ‘k1’ with ‘k’
- When matching kinds
- a0 :: k
- a :: k1
- Expected kind ‘a0 :~: a0’, but ‘e :: a :~: a’ has kind ‘a :~: a’
- • In the second argument of ‘Foo2’, namely ‘(e :: a :~: a)’
- In the type family declaration for ‘Foo2’
diff --git a/testsuite/tests/indexed-types/should_fail/T15870.stderr b/testsuite/tests/indexed-types/should_fail/T15870.stderr
index 2cba04fd97..ce087941ea 100644
--- a/testsuite/tests/indexed-types/should_fail/T15870.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T15870.stderr
@@ -2,6 +2,9 @@
T15870.hs:32:34: error:
• Couldn't match kind ‘k’ with ‘*’
Expected kind ‘Optic a’, but ‘g2’ has kind ‘Optic b’
+ ‘k’ is a rigid type variable bound by
+ a family instance declaration
+ at T15870.hs:(27,1)-(32,35)
• In the second argument of ‘Get’, namely ‘g2’
In the type ‘Get a g2’
In the type instance declaration for ‘Get’
diff --git a/testsuite/tests/indexed-types/should_fail/T5439.stderr b/testsuite/tests/indexed-types/should_fail/T5439.stderr
index 5dcce91edb..c7f230654e 100644
--- a/testsuite/tests/indexed-types/should_fail/T5439.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T5439.stderr
@@ -3,7 +3,8 @@ T5439.hs:82:33: error:
• Couldn't match expected type: Attempt (HElemOf rs)
with actual type: Attempt (HHead (HDrop n0 l0))
-> Attempt (HElemOf l0)
- • In the second argument of ‘($)’, namely
+ • Probable cause: ‘($)’ is applied to too few arguments
+ In the second argument of ‘($)’, namely
‘inj $ Failure (e :: SomeException)’
In a stmt of a 'do' block:
c <- complete ev $ inj $ Failure (e :: SomeException)
diff --git a/testsuite/tests/indexed-types/should_fail/T7354.stderr b/testsuite/tests/indexed-types/should_fail/T7354.stderr
index 1a20e096f1..f8ebc7d923 100644
--- a/testsuite/tests/indexed-types/should_fail/T7354.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7354.stderr
@@ -3,6 +3,9 @@ T7354.hs:28:11: error:
• Couldn't match type ‘p’ with ‘Base t (Prim [p] p)’
Expected: Prim [p] p -> Base t (Prim [p] p)
Actual: Prim [p] p -> p
+ ‘p’ is a rigid type variable bound by
+ the inferred type of foo :: Prim [p] p -> t
+ at T7354.hs:28:1-13
• In the first argument of ‘ana’, namely ‘alg’
In the expression: ana alg
In an equation for ‘foo’: foo = ana alg
diff --git a/testsuite/tests/linear/should_fail/LinearConfusedDollar.stderr b/testsuite/tests/linear/should_fail/LinearConfusedDollar.stderr
index 4abdd1c18c..61d7aa2f45 100644
--- a/testsuite/tests/linear/should_fail/LinearConfusedDollar.stderr
+++ b/testsuite/tests/linear/should_fail/LinearConfusedDollar.stderr
@@ -1,6 +1,8 @@
LinearConfusedDollar.hs:12:7: error:
- • Couldn't match type ‘'Many’ with ‘'One’
- arising from an application
- • In the expression: f $ x
+ • Couldn't match type ‘'One’ with ‘'Many’
+ Expected: a -> a
+ Actual: a #-> a
+ • In the first argument of ‘($)’, namely ‘f’
+ In the expression: f $ x
In an equation for ‘g’: g x = f $ x
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
index 836b27f9e5..73a1b9b4d8 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
@@ -1,6 +1,7 @@
overloadedrecfldsfail07.hs:7:7: error:
• Couldn't match expected type ‘T’ with actual type ‘T -> Int’
- • In the first argument of ‘x’, namely ‘x’
+ • Probable cause: ‘x’ is applied to too few arguments
+ In the first argument of ‘x’, namely ‘x’
In the expression: x x
In an equation for ‘y’: y = x x
diff --git a/testsuite/tests/parser/should_fail/readFail003.stderr b/testsuite/tests/parser/should_fail/readFail003.stderr
index dbcc63f419..f43a759083 100644
--- a/testsuite/tests/parser/should_fail/readFail003.stderr
+++ b/testsuite/tests/parser/should_fail/readFail003.stderr
@@ -2,6 +2,12 @@
readFail003.hs:4:27: error:
• Couldn't match expected type ‘(a, [a1], [a2])’
with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the inferred types of
+ a :: a
+ b :: [a1]
+ c :: [a2]
+ at readFail003.hs:(4,1)-(8,26)
• In the expression: a
In a pattern binding:
~(a, b, c)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
index e59a28a99d..a3cdc763fc 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -36,8 +36,8 @@ T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
...plus two instances involving out-of-scope types
(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)
+ In an equation for ‘h2’: h2 f b = (H . fmap (const ())) (fmap f b)
T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘f0’ with ‘B t’
diff --git a/testsuite/tests/partial-sigs/should_fail/T14584.stderr b/testsuite/tests/partial-sigs/should_fail/T14584.stderr
index ced11e50a2..0e7967a276 100644
--- a/testsuite/tests/partial-sigs/should_fail/T14584.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T14584.stderr
@@ -1,7 +1,7 @@
T14584.hs:56:41: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Could not deduce (SingI a) arising from a use of ‘sing’
- from the context: (Action act, Monoid a, Good m1)
+ from the context: (Action act, Monoid a, Good m)
bound by the instance declaration at T14584.hs:54:10-89
• In the second argument of ‘fromSing’, namely
‘(sing @m @a :: Sing _)’
@@ -11,10 +11,10 @@ T14584.hs:56:41: warning: [-Wdeferred-type-errors (in -Wdefault)]
act @_ @_ @act (fromSing @m (sing @m @a :: Sing _))
T14584.hs:56:50: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Could not deduce: m1 ~ *
- from the context: (Action act, Monoid a, Good m1)
+ • Could not deduce: m ~ *
+ from the context: (Action act, Monoid a, Good m)
bound by the instance declaration at T14584.hs:54:10-89
- ‘m1’ is a rigid type variable bound by
+ ‘m’ is a rigid type variable bound by
the instance declaration
at T14584.hs:54:10-89
• In the type ‘a’
diff --git a/testsuite/tests/partial-sigs/should_fail/T14584a.stderr b/testsuite/tests/partial-sigs/should_fail/T14584a.stderr
index 9d7ab35dd5..c3e957b9dd 100644
--- a/testsuite/tests/partial-sigs/should_fail/T14584a.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T14584a.stderr
@@ -1,14 +1,15 @@
T14584a.hs:12:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘()’ with actual type ‘m -> m’
- • In the expression: id @m :: _
+ • Probable cause: ‘id @m :: _’ is applied to too few arguments
+ In the expression: id @m :: _
In an equation for ‘f’: f = id @m :: _
T14584a.hs:12:9: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Expected a type, but ‘m’ has kind ‘k2’
- ‘k2’ is a rigid type variable bound by
+ • Expected a type, but ‘m’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
the type signature for:
- f :: forall {k2} (m :: k2). ()
+ f :: forall {k} (m :: k). ()
at T14584a.hs:11:1-17
• In the type ‘m’
In the expression: id @m :: _
@@ -18,7 +19,7 @@ T14584a.hs:12:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘m -> m’
Where: ‘m’, ‘k’ are rigid type variables bound by
the type signature for:
- f :: forall {k2} (m :: k2). ()
+ f :: forall {k} (m :: k). ()
at T14584a.hs:11:1-17
• In an expression type signature: _
In the expression: id @m :: _
@@ -26,10 +27,10 @@ T14584a.hs:12:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Relevant bindings include f :: () (bound at T14584a.hs:12:1)
T14584a.hs:15:17: warning: [-Wdeferred-type-errors (in -Wdefault)]
- • Expected a type, but ‘m’ has kind ‘k2’
- ‘k2’ is a rigid type variable bound by
+ • Expected a type, but ‘m’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
the type signature for:
- g :: forall {k2} (m :: k2). ()
+ g :: forall {k} (m :: k). ()
at T14584a.hs:14:1-17
• In the type ‘m’
In the expression: id @m
diff --git a/testsuite/tests/patsyn/should_fail/T15685.stderr b/testsuite/tests/patsyn/should_fail/T15685.stderr
index 37627b852b..e081453659 100644
--- a/testsuite/tests/patsyn/should_fail/T15685.stderr
+++ b/testsuite/tests/patsyn/should_fail/T15685.stderr
@@ -1,19 +1,13 @@
T15685.hs:13:24: error:
- • Couldn't match kind ‘a1’ with ‘[k0]’
- When matching types
- f :: a1 -> *
- NP a0 :: [k0] -> *
- Expected: f a2
- Actual: NP a0 b0
- ‘a1’ is untouchable
- inside the constraints: as ~ (a2 : as1)
- bound by a pattern with constructor:
- Here :: forall {a1} (f :: a1 -> *) (a2 :: a1) (as :: [a1]).
- f a2 -> NS f (a2 : as),
- in a pattern synonym declaration
- at T15685.hs:13:19-26
- ‘a1’ is a rigid type variable bound by
+ • Could not deduce: a ~ [k0]
+ from the context: as ~ (a1 : as1)
+ bound by a pattern with constructor:
+ Here :: forall {a1} (f :: a1 -> *) (a2 :: a1) (as :: [a1]).
+ f a2 -> NS f (a2 : as),
+ in a pattern synonym declaration
+ at T15685.hs:13:19-26
+ ‘a’ is a rigid type variable bound by
the inferred type of HereNil :: NS f as
at T15685.hs:13:9-15
Possible fix: add a type signature for ‘HereNil’
diff --git a/testsuite/tests/patsyn/should_fail/T15694.stderr b/testsuite/tests/patsyn/should_fail/T15694.stderr
index 360fb30ba2..7e1507c332 100644
--- a/testsuite/tests/patsyn/should_fail/T15694.stderr
+++ b/testsuite/tests/patsyn/should_fail/T15694.stderr
@@ -1,4 +1,7 @@
T15694.hs:22:35: error:
- • Expected kind ‘k1 -> k00’, but ‘f a1’ has kind ‘ks’
+ • Expected kind ‘k1 -> k0’, but ‘f a1’ has kind ‘ks’
+ ‘ks’ is a rigid type variable bound by
+ the data constructor ‘ASSO’
+ at T15694.hs:18:30-31
• In the first argument of ‘(~~)’, namely ‘f a1 a2’
diff --git a/testsuite/tests/patsyn/should_fail/T15695.stderr b/testsuite/tests/patsyn/should_fail/T15695.stderr
index 2e834c6d08..82398e15a7 100644
--- a/testsuite/tests/patsyn/should_fail/T15695.stderr
+++ b/testsuite/tests/patsyn/should_fail/T15695.stderr
@@ -1,7 +1,7 @@
T15695.hs:39:14: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Could not deduce: a2 ~ NA 'VO
- from the context: ((* -> * -> *) ~ (k1 -> k2 -> *), Either ~~ f,
+ from the context: ((* -> * -> *) ~ (k -> k1 -> *), Either ~~ f,
ctx ~~ (a2 ':&: (a3 ':&: 'E)), f a2 ~~ f1, f1 a3 ~~ a4)
bound by a pattern with pattern synonym:
ASSO :: forall kind (a :: kind) (b :: Ctx kind).
diff --git a/testsuite/tests/plugins/test-hole-plugin.stderr b/testsuite/tests/plugins/test-hole-plugin.stderr
index 7ca539e8d7..109736fa78 100644
--- a/testsuite/tests/plugins/test-hole-plugin.stderr
+++ b/testsuite/tests/plugins/test-hole-plugin.stderr
@@ -2,8 +2,7 @@
test-hole-plugin.hs:12:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _too_long :: [Int] -> Int
Or perhaps ‘_too_long’ is mis-spelled, or not in scope
- • In the expression: _too_long
- In an equation for ‘f’: f = _too_long
+ • In an equation for ‘f’: f = _too_long
• Relevant bindings include
f :: [Int] -> Int (bound at test-hole-plugin.hs:12:1)
Valid hole fits include
@@ -11,8 +10,7 @@ test-hole-plugin.hs:12:5: warning: [-Wtyped-holes (in -Wdefault)]
test-hole-plugin.hs:13:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [Int] -> Int
- • In the expression: _
- In an equation for ‘j’: j = _
+ • In an equation for ‘j’: j = _
• Relevant bindings include
j :: [Int] -> Int (bound at test-hole-plugin.hs:13:1)
Valid hole fits include
@@ -27,8 +25,7 @@ test-hole-plugin.hs:13:5: warning: [-Wtyped-holes (in -Wdefault)]
test-hole-plugin.hs:14:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _sort_by_mod_desc :: [Int] -> Int
Or perhaps ‘_sort_by_mod_desc’ is mis-spelled, or not in scope
- • In the expression: _sort_by_mod_desc
- In an equation for ‘i’: i = _sort_by_mod_desc
+ • In an equation for ‘i’: i = _sort_by_mod_desc
• Relevant bindings include
i :: [Int] -> Int (bound at test-hole-plugin.hs:14:1)
Valid hole fits include
@@ -43,8 +40,7 @@ test-hole-plugin.hs:14:5: warning: [-Wtyped-holes (in -Wdefault)]
test-hole-plugin.hs:15:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _only_Data_List :: [Int] -> Int
Or perhaps ‘_only_Data_List’ is mis-spelled, or not in scope
- • In the expression: _only_Data_List
- In an equation for ‘g’: g = _only_Data_List
+ • In an equation for ‘g’: g = _only_Data_List
• Relevant bindings include
g :: [Int] -> Int (bound at test-hole-plugin.hs:15:1)
Valid hole fits include
@@ -54,8 +50,7 @@ test-hole-plugin.hs:15:5: warning: [-Wtyped-holes (in -Wdefault)]
test-hole-plugin.hs:16:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _only_Prelude :: [Int] -> Int
Or perhaps ‘_only_Prelude’ is mis-spelled, or not in scope
- • In the expression: _only_Prelude
- In an equation for ‘h’: h = _only_Prelude
+ • In an equation for ‘h’: h = _only_Prelude
• Relevant bindings include
h :: [Int] -> Int (bound at test-hole-plugin.hs:16:1)
Valid hole fits include
diff --git a/testsuite/tests/polykinds/T11520.stderr b/testsuite/tests/polykinds/T11520.stderr
index 11a81baf62..156f8490e8 100644
--- a/testsuite/tests/polykinds/T11520.stderr
+++ b/testsuite/tests/polykinds/T11520.stderr
@@ -1,6 +1,9 @@
T11520.hs:15:77: error:
• Expected kind ‘k20 -> k10’, but ‘g’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
+ the instance declaration
+ at T11520.hs:(15,1)-(16,23)
• In the second argument of ‘Compose’, namely ‘g’
In the first argument of ‘Typeable’, namely ‘(Compose f g)’
In the instance declaration for ‘Typeable (Compose f g)’
diff --git a/testsuite/tests/polykinds/T12593.stderr b/testsuite/tests/polykinds/T12593.stderr
index 5ce7b07187..fcf194ba50 100644
--- a/testsuite/tests/polykinds/T12593.stderr
+++ b/testsuite/tests/polykinds/T12593.stderr
@@ -1,16 +1,9 @@
-T12593.hs:11:16: error:
- • Expected kind ‘k0 -> k1 -> *’, but ‘Free k k1 k2 p’ has kind ‘*’
- • In the type signature:
- run :: k2 q =>
- Free k k1 k2 p a b
- -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b
-
T12593.hs:12:31: error:
• Expecting one more argument to ‘k’
Expected a type, but
‘k’ has kind
- ‘((k2 -> Constraint) -> k3 -> *) -> Constraint’
+ ‘((k0 -> Constraint) -> k1 -> *) -> Constraint’
• In the kind ‘k’
In the type signature:
run :: k2 q =>
diff --git a/testsuite/tests/polykinds/T14172.hs b/testsuite/tests/polykinds/T14172.hs
index 10fff5af69..06956be91a 100644
--- a/testsuite/tests/polykinds/T14172.hs
+++ b/testsuite/tests/polykinds/T14172.hs
@@ -5,3 +5,8 @@ import T14172a
traverseCompose :: (a -> f b) -> g a -> f (h _)
traverseCompose = _Wrapping Compose . traverse
+
+-- traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
+-- (.) :: (y->z) -> (x->y) -> (x -> z)
+-- x := a -> f b
+-- z := g a -> f (h a1)
diff --git a/testsuite/tests/polykinds/T14172.stderr b/testsuite/tests/polykinds/T14172.stderr
index d27f45bb9c..0f5d0271b4 100644
--- a/testsuite/tests/polykinds/T14172.stderr
+++ b/testsuite/tests/polykinds/T14172.stderr
@@ -15,6 +15,10 @@ T14172.hs:7:19: error:
Expected: (f'0 a -> f (f'0 b)) -> Compose f'0 g'0 a -> f (h a')
Actual: (Unwrapped (Compose f'0 g'0 a) -> f (Unwrapped (h a')))
-> Compose f'0 g'0 a -> f (h a')
+ ‘a’ is a rigid type variable bound by
+ the inferred type of
+ traverseCompose :: (a -> f b) -> g a -> f (h a')
+ at T14172.hs:6:1-47
• In the first argument of ‘(.)’, namely ‘_Wrapping Compose’
In the expression: _Wrapping Compose . traverse
In an equation for ‘traverseCompose’:
diff --git a/testsuite/tests/polykinds/T14846.stderr b/testsuite/tests/polykinds/T14846.stderr
index 2d49b819a0..8ff308ba1d 100644
--- a/testsuite/tests/polykinds/T14846.stderr
+++ b/testsuite/tests/polykinds/T14846.stderr
@@ -5,14 +5,14 @@ T14846.hs:38:8: error:
Actual: Hom riki a a
‘ríki’ is a rigid type variable bound by
the type signature for:
- i :: forall {k5} {k6} {cls3 :: k6 -> Constraint} (xx :: k5)
- (a :: Struct cls3) (ríki :: Struct cls3 -> Struct cls3 -> *).
+ i :: forall {k4} {k5} {cls2 :: k5 -> Constraint} (xx :: k4)
+ (a :: Struct cls2) (ríki :: Struct cls2 -> Struct cls2 -> *).
StructI xx a =>
ríki a a
at T14846.hs:38:8-48
• When checking that instance signature for ‘i’
is more general than its signature in the class
- Instance sig: forall {k1} {k2} {cls :: k2 -> Constraint} (xx :: k1)
+ Instance sig: forall {k1} {k3} {cls :: k3 -> Constraint} (xx :: k1)
(a :: Struct cls).
StructI xx a =>
Hom riki a a
@@ -23,10 +23,10 @@ T14846.hs:38:8: error:
In the instance declaration for ‘Category (Hom riki)’
T14846.hs:39:44: error:
- • Couldn't match kind ‘k4’ with ‘Struct cls3’
- Expected kind ‘Struct cls3 -> Constraint’,
- but ‘cls’ has kind ‘k4 -> Constraint’
- ‘k4’ is a rigid type variable bound by
+ • Couldn't match kind ‘k3’ with ‘Struct cls2’
+ Expected kind ‘Struct cls2 -> Constraint’,
+ but ‘cls’ has kind ‘k3 -> Constraint’
+ ‘k3’ is a rigid type variable bound by
the instance declaration
at T14846.hs:37:10-65
• In the second argument of ‘Structured’, namely ‘cls’
diff --git a/testsuite/tests/polykinds/T15787.stderr b/testsuite/tests/polykinds/T15787.stderr
index 88eca5c1ac..7241e2f7fb 100644
--- a/testsuite/tests/polykinds/T15787.stderr
+++ b/testsuite/tests/polykinds/T15787.stderr
@@ -1,6 +1,9 @@
T15787.hs:15:14: error:
• Expected a type, but ‘k’ has kind ‘ob’
+ ‘ob’ is a rigid type variable bound by
+ the data constructor ‘Kl’
+ at T15787.hs:15:3-43
• In the type ‘k’
In the definition of data constructor ‘Kl’
In the data declaration for ‘Kl_kind’
diff --git a/testsuite/tests/polykinds/T16221a.stderr b/testsuite/tests/polykinds/T16221a.stderr
index 27edc2c8ec..7b550b6c8f 100644
--- a/testsuite/tests/polykinds/T16221a.stderr
+++ b/testsuite/tests/polykinds/T16221a.stderr
@@ -1,6 +1,12 @@
T16221a.hs:6:49: error:
- • Expected kind ‘k1’, but ‘b’ has kind ‘k’
+ • Expected kind ‘k’, but ‘b’ has kind ‘k1’
+ ‘k1’ is a rigid type variable bound by
+ the data constructor ‘MkT2’
+ at T16221a.hs:6:20
+ ‘k’ is a rigid type variable bound by
+ the data constructor ‘MkT2’
+ at T16221a.hs:6:20
• In the second argument of ‘SameKind’, namely ‘b’
In the type ‘(SameKind a b)’
In the definition of data constructor ‘MkT2’
diff --git a/testsuite/tests/polykinds/T16245a.hs b/testsuite/tests/polykinds/T16245a.hs
new file mode 100644
index 0000000000..d649701261
--- /dev/null
+++ b/testsuite/tests/polykinds/T16245a.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeInType #-}
+module Bug where
+
+import Data.Kind
+
+type Const a b = a
+data SameKind :: k -> k -> Type
+
+newtype T (k :: Const Type a) = MkT (forall (b :: k). SameKind a b)
diff --git a/testsuite/tests/polykinds/T16245a.stderr b/testsuite/tests/polykinds/T16245a.stderr
new file mode 100644
index 0000000000..6279ba18bb
--- /dev/null
+++ b/testsuite/tests/polykinds/T16245a.stderr
@@ -0,0 +1,12 @@
+
+T16245a.hs:10:66: error:
+ • Expected kind ‘k’, but ‘b’ has kind ‘k1’
+ ‘k1’ is a rigid type variable bound by
+ the data constructor ‘MkT’
+ at T16245a.hs:10:12
+ ‘k’ is a rigid type variable bound by
+ the data constructor ‘MkT’
+ at T16245a.hs:10:1-67
+ • In the second argument of ‘SameKind’, namely ‘b’
+ In the type ‘(forall (b :: k). SameKind a b)’
+ In the definition of data constructor ‘MkT’
diff --git a/testsuite/tests/polykinds/T16902.stderr b/testsuite/tests/polykinds/T16902.stderr
index 2da3e41c36..61d1b0a2ae 100644
--- a/testsuite/tests/polykinds/T16902.stderr
+++ b/testsuite/tests/polykinds/T16902.stderr
@@ -1,6 +1,9 @@
T16902.hs:11:10: error:
• Expected a type, but found something with kind ‘a’
+ ‘a’ is a rigid type variable bound by
+ the data constructor ‘MkF’
+ at T16902.hs:11:3-12
• In the type ‘F a’
In the definition of data constructor ‘MkF’
In the data declaration for ‘F’
diff --git a/testsuite/tests/polykinds/T17841.stderr b/testsuite/tests/polykinds/T17841.stderr
index de33036dcf..739e4f2680 100644
--- a/testsuite/tests/polykinds/T17841.stderr
+++ b/testsuite/tests/polykinds/T17841.stderr
@@ -1,7 +1,7 @@
T17841.hs:7:45: error:
- • Expected a type, but ‘t’ has kind ‘k2’
- ‘k2’ is a rigid type variable bound by
+ • Expected a type, but ‘t’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
the class declaration for ‘Foo’
at T17841.hs:7:12-17
• In the kind ‘t’
diff --git a/testsuite/tests/polykinds/T17963.stderr b/testsuite/tests/polykinds/T17963.stderr
index 5cade1ded2..e38d216faf 100644
--- a/testsuite/tests/polykinds/T17963.stderr
+++ b/testsuite/tests/polykinds/T17963.stderr
@@ -1,10 +1,10 @@
T17963.hs:15:23: error:
- • Couldn't match kind ‘rep1’ with ‘'LiftedRep’
+ • Couldn't match kind ‘rep’ with ‘'LiftedRep’
When matching kinds
k0 :: *
- ob :: TYPE rep1
- ‘rep1’ is a rigid type variable bound by
+ ob :: TYPE rep
+ ‘rep’ is a rigid type variable bound by
the class declaration for ‘Category'’
at T17963.hs:13:27-29
• In the first argument of ‘cat’, namely ‘a’
diff --git a/testsuite/tests/polykinds/T7438.stderr b/testsuite/tests/polykinds/T7438.stderr
index 34440d774e..dd953fa69a 100644
--- a/testsuite/tests/polykinds/T7438.stderr
+++ b/testsuite/tests/polykinds/T7438.stderr
@@ -1,16 +1,17 @@
T7438.hs:6:14: error:
- • Couldn't match expected type ‘p1’ with actual type ‘p’
- ‘p’ is untouchable
- inside the constraints: b ~ a
- 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
+ • Could not deduce: p ~ p1
+ from the context: b ~ a
+ 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
‘p’ is a rigid type variable bound by
- the inferred type of go :: Thrist a b -> p -> p1 at T7438.hs:6:1-16
+ the inferred type of go :: Thrist a b -> p -> p1
+ at T7438.hs:6:1-16
‘p1’ is a rigid type variable bound by
- the inferred type of go :: Thrist a b -> p -> p1 at T7438.hs:6:1-16
+ the inferred type of go :: Thrist a b -> p -> p1
+ 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
diff --git a/testsuite/tests/polykinds/T7594.stderr b/testsuite/tests/polykinds/T7594.stderr
index ea5484d464..fc0aa1fcc3 100644
--- a/testsuite/tests/polykinds/T7594.stderr
+++ b/testsuite/tests/polykinds/T7594.stderr
@@ -1,13 +1,12 @@
T7594.hs:37:12: error:
- • Couldn't match type ‘b’ with ‘IO ()’
+ • Could not deduce: b ~ IO ()
+ from the context: (:&:) c0 Real a
+ bound by a type expected by the context:
+ forall a. (:&:) c0 Real a => a -> b
+ at T7594.hs:37:12-16
Expected: a -> b
Actual: a -> IO ()
- ‘b’ is untouchable
- inside the constraints: (:&:) c0 Real a
- bound by a type expected by the context:
- forall a. (:&:) c0 Real a => a -> b
- at T7594.hs:37:12-16
‘b’ is a rigid type variable bound by
the inferred type of bar2 :: b
at T7594.hs:37:1-19
diff --git a/testsuite/tests/polykinds/T7805.stderr b/testsuite/tests/polykinds/T7805.stderr
index 869ecc9200..e4fdff52e0 100644
--- a/testsuite/tests/polykinds/T7805.stderr
+++ b/testsuite/tests/polykinds/T7805.stderr
@@ -1,8 +1,6 @@
T7805.hs:7:21: error:
- • Expected kind ‘forall a. a -> a’, but ‘x’ has kind ‘k0’
- Cannot instantiate unification variable ‘k0’
- with a kind involving polytypes: forall a. a -> a
+ • Expected kind ‘forall a. a -> a’, but ‘x’ has kind ‘*’
• In the first argument of ‘HR’, namely ‘x’
In the first argument of ‘F’, namely ‘(HR x)’
In the type instance declaration for ‘F’
diff --git a/testsuite/tests/polykinds/T8616.stderr b/testsuite/tests/polykinds/T8616.stderr
index 653f3beb1a..71c2f00584 100644
--- a/testsuite/tests/polykinds/T8616.stderr
+++ b/testsuite/tests/polykinds/T8616.stderr
@@ -1,14 +1,12 @@
-T8616.hs:8:16: error:
- • Couldn't match kind ‘k1’ with ‘*’
- When matching types
- Any :: k1
- Proxy kproxy :: *
- ‘k1’ is a rigid type variable bound by
+T8616.hs:8:30: error:
+ • Expected a type, but ‘Any :: k’ has kind ‘k’
+ ‘k’ is a rigid type variable bound by
the type signature for:
- withSomeSing :: forall k1 (kproxy :: k1). Proxy kproxy
+ withSomeSing :: forall k (kproxy :: k). Proxy kproxy
at T8616.hs:7:1-52
- • In the expression: undefined :: (Any :: k)
+ • In an expression type signature: (Any :: k)
+ In the expression: undefined :: (Any :: k)
In an equation for ‘withSomeSing’:
withSomeSing = undefined :: (Any :: k)
• Relevant bindings include
diff --git a/testsuite/tests/polykinds/T9017.stderr b/testsuite/tests/polykinds/T9017.stderr
index 2fc5bb1792..b18efe0111 100644
--- a/testsuite/tests/polykinds/T9017.stderr
+++ b/testsuite/tests/polykinds/T9017.stderr
@@ -1,15 +1,14 @@
T9017.hs:8:7: error:
- • Couldn't match kind ‘k2’ with ‘*’
+ • Couldn't match kind ‘k’ with ‘*’
When matching types
a0 :: * -> * -> *
- a :: k2 -> k3 -> *
+ a :: k -> k1 -> *
Expected: a b (m b)
Actual: a0 b0 (m0 b0)
- ‘k2’ is a rigid type variable bound by
+ ‘k’ is a rigid type variable bound by
the type signature for:
- foo :: forall {k2} {k3} (a :: k2 -> k3 -> *) (b :: k2)
- (m :: k2 -> k3).
+ foo :: forall {k} {k1} (a :: k -> k1 -> *) (b :: k) (m :: k -> k1).
a b (m b)
at T9017.hs:7:1-16
• In the expression: arr return
diff --git a/testsuite/tests/polykinds/TyVarTvKinds3.stderr b/testsuite/tests/polykinds/TyVarTvKinds3.stderr
index 67da965d09..b0b7924444 100644
--- a/testsuite/tests/polykinds/TyVarTvKinds3.stderr
+++ b/testsuite/tests/polykinds/TyVarTvKinds3.stderr
@@ -1,6 +1,12 @@
TyVarTvKinds3.hs:9:62: error:
• Expected kind ‘k1’, but ‘b’ has kind ‘k2’
+ ‘k2’ is a rigid type variable bound by
+ the data constructor ‘MkBad’
+ at TyVarTvKinds3.hs:9:22-23
+ ‘k1’ is a rigid type variable bound by
+ the data constructor ‘MkBad’
+ at TyVarTvKinds3.hs:9:19-20
• In the second argument of ‘SameKind’, namely ‘b’
In the first argument of ‘Bad’, namely ‘(SameKind a b)’
In the type ‘Bad (SameKind a b)’
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 1ff66e63ab..b167b930dc 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -213,6 +213,7 @@ test('T16221', normal, compile, [''])
test('T16221a', normal, compile_fail, [''])
test('T16244', normal, compile_fail, [''])
test('T16245', normal, compile_fail, [''])
+test('T16245a', normal, compile_fail, [''])
test('T16342', normal, compile, [''])
test('T16263', normal, compile_fail, [''])
test('T16902', normal, compile_fail, [''])
diff --git a/testsuite/tests/saks/should_fail/saks_fail019.stderr b/testsuite/tests/saks/should_fail/saks_fail019.stderr
index 30882c15ec..b34a7e1905 100644
--- a/testsuite/tests/saks/should_fail/saks_fail019.stderr
+++ b/testsuite/tests/saks/should_fail/saks_fail019.stderr
@@ -3,4 +3,7 @@ saks_fail019.hs:9:1: error:
• Couldn't match kind ‘a’ with ‘*’
Expected: a -> *
Actual: * -> *
+ ‘a’ is a rigid type variable bound by
+ the data type declaration for ‘T’
+ at saks_fail019.hs:9:8
• In the data type declaration for ‘T’
diff --git a/testsuite/tests/simplCore/should_compile/simpl017.stderr b/testsuite/tests/simplCore/should_compile/simpl017.stderr
index 96c8e1ea2d..0326e339fb 100644
--- a/testsuite/tests/simplCore/should_compile/simpl017.stderr
+++ b/testsuite/tests/simplCore/should_compile/simpl017.stderr
@@ -1,22 +1,46 @@
-simpl017.hs:50:15: error:
+simpl017.hs:55:5: error:
• Couldn't match type: [E m i] -> E' v0 m a
with: forall v. [E m i] -> E' v m a
- Expected: E m (forall v. [E m i] -> E' v m a)
- Actual: E' RValue m ([E m i] -> E' v0 m a)
- • In the expression:
+ Expected: m (forall v. [E m i] -> E' v m a)
+ Actual: m ([E m i] -> E' v0 m a)
+ • In a stmt of a 'do' block: return f
+ In the first argument of ‘E’, namely
+ ‘(do let ix :: [E m i] -> m i
+ ix [i] = runE i
+ {-# INLINE f #-}
+ ....
+ return f)’
+ In the expression:
E (do let ix :: [E m i] -> m i
ix [i] = runE i
{-# INLINE f #-}
....
return f)
- In an equation for ‘liftArray’:
- liftArray a
- = E (do let ix :: [E m i] -> m i
- ix [i] = runE i
- ....
- return f)
• Relevant bindings include
+ f :: [E m i] -> E' v0 m a (bound at simpl017.hs:54:9)
+ ix :: [E m i] -> m i (bound at simpl017.hs:52:9)
a :: arr i a (bound at simpl017.hs:50:11)
liftArray :: arr i a -> E m (forall v. [E m i] -> E' v m a)
(bound at simpl017.hs:50:1)
+
+simpl017.hs:71:10: error:
+ • Couldn't match type: forall v. [E (ST s) Int] -> E' v (ST s) Int
+ with: [E (ST t0) Int] -> E (ST s) Int
+ Expected: E' RValue (ST s) ([E (ST t0) Int] -> E (ST s) Int)
+ Actual: E (ST s) (forall v. [E (ST s) Int] -> E' v (ST s) Int)
+ • In a stmt of a 'do' block: a <- liftArray ma
+ In the second argument of ‘($)’, namely
+ ‘do a <- liftArray ma
+ let one :: E (ST t) Int
+ one = return 1
+ a [one] `plus` a [one]’
+ In the expression:
+ runE
+ $ do a <- liftArray ma
+ let one :: E (ST t) Int
+ one = return 1
+ a [one] `plus` a [one]
+ • Relevant bindings include
+ ma :: STArray s Int Int (bound at simpl017.hs:70:5)
+ foo :: STArray s Int Int -> ST s Int (bound at simpl017.hs:70:1)
diff --git a/testsuite/tests/th/T10267.stderr b/testsuite/tests/th/T10267.stderr
index 6262bf72ff..2f5598fa1d 100644
--- a/testsuite/tests/th/T10267.stderr
+++ b/testsuite/tests/th/T10267.stderr
@@ -5,8 +5,7 @@ T10267.hs:8:1: error:
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 = _
+ • 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)
@@ -19,8 +18,7 @@ T10267.hs:8:1: error:
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
+ • In an equation for ‘i’: i = _foo
• Relevant bindings include i :: a -> a (bound at T10267.hs:8:1)
Valid hole fits include
i :: a -> a (bound at T10267.hs:8:1)
diff --git a/testsuite/tests/th/T15321.stderr b/testsuite/tests/th/T15321.stderr
index 3054f02afc..1de67decef 100644
--- a/testsuite/tests/th/T15321.stderr
+++ b/testsuite/tests/th/T15321.stderr
@@ -1,8 +1,7 @@
T15321.hs:9:9: error:
• Found hole: _ :: String -> Language.Haskell.TH.Lib.Internal.ExpQ
- • In the expression: _
- In the expression: _ "baz"
+ • In the expression: _ "baz"
In the untyped splice: $(_ "baz")
• Valid hole fits include
fail :: forall (m :: * -> *) a. MonadFail m => String -> m a
diff --git a/testsuite/tests/typecheck/should_compile/PolytypeDecomp.hs b/testsuite/tests/typecheck/should_compile/PolytypeDecomp.hs
index 69e4fb31c7..dbbec52eaa 100644
--- a/testsuite/tests/typecheck/should_compile/PolytypeDecomp.hs
+++ b/testsuite/tests/typecheck/should_compile/PolytypeDecomp.hs
@@ -1,32 +1,34 @@
{-# LANGUAGE TypeFamilies, LiberalTypeSynonyms, ImpredicativeTypes #-}
-module PolyTypeDecomp where
+module PolyTypeDecomp where
-{- The purpose of this test is to check if decomposition of wanted
+{- The purpose of this test is to check if decomposition of wanted
equalities in the /constraint solver/ (vs. the unifier) works properly.
- Unfortunately most equalities between polymorphic types are converted to
+ Unfortunately most equalities between polymorphic types are converted to
implication constraints early on in the unifier, so we have to make things
- a bit more convoluted by introducing the myLength function. The wanted
+ a bit more convoluted by introducing the myLength function. The wanted
constraints we get for this program are:
[forall a. Maybe a] ~ Id alpha
- [forall a. F [a]] ~ Id alpha
- Which, /after reactions/ should create a fresh implication:
+ [forall a. F [a]] ~ Id alpha
+ Which, /after reactions/ should create a fresh implication:
forall a. Maybe a ~ F [a]
that is perfectly soluble.
-}
-
+
type family F a
-type instance F [a] = Maybe a
+type instance F [a] = Maybe a
-type family Id a
+type family Id a
type instance Id a = a
f :: [forall a. F [a]]
f = undefined
+-- This can't possibly work, even with Quick Look
g :: [forall a. Maybe a] -> Int
g x = myLength [x,f]
+-- [x,f] :: [[forall a. Maybe a]]
-myLength :: [Id a] -> Int
+myLength :: [Id a] -> Int
myLength = undefined
diff --git a/testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr b/testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr
new file mode 100644
index 0000000000..bde2a0d703
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr
@@ -0,0 +1,20 @@
+
+PolytypeDecomp.hs:30:17: error:
+ • Couldn't match type ‘a0’ with ‘[forall a. Maybe a]’
+ Expected: Id a0
+ Actual: [forall a. Maybe a]
+ Cannot instantiate unification variable ‘a0’
+ with a type involving polytypes: [forall a. Maybe a]
+ • In the expression: x
+ In the first argument of ‘myLength’, namely ‘[x, f]’
+ In the expression: myLength [x, f]
+
+PolytypeDecomp.hs:30:19: error:
+ • Couldn't match type ‘a0’ with ‘[forall a. F [a]]’
+ Expected: Id a0
+ Actual: [forall a. F [a]]
+ Cannot instantiate unification variable ‘a0’
+ with a type involving polytypes: [forall a. F [a]]
+ • In the expression: f
+ In the first argument of ‘myLength’, namely ‘[x, f]’
+ In the expression: myLength [x, f]
diff --git a/testsuite/tests/typecheck/should_compile/T10971a.stderr b/testsuite/tests/typecheck/should_compile/T10971a.stderr
index 96330fd61a..800dc84efa 100644
--- a/testsuite/tests/typecheck/should_compile/T10971a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10971a.stderr
@@ -35,8 +35,8 @@ T10971a.hs:9:6: warning: [-Wname-shadowing (in -Wall)]
T10971a.hs:9:14: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraints to type ‘[]’
(Traversable t0)
- arising from a use of ‘fmapDefault’ at T10971a.hs:9:14-28
- (Foldable t0) arising from a use of ‘length’ at T10971a.hs:9:31-38
+ arising from a use of ‘fmapDefault’ at T10971a.hs:9:14-24
+ (Foldable t0) arising from a use of ‘length’ at T10971a.hs:9:31-36
• In the expression: fmapDefault f x
In the expression: (fmapDefault f x, length x)
In the expression: \ f x -> (fmapDefault f x, length x)
diff --git a/testsuite/tests/typecheck/should_compile/T13050.stderr b/testsuite/tests/typecheck/should_compile/T13050.stderr
index 89f2b80d3b..92db8e2b63 100644
--- a/testsuite/tests/typecheck/should_compile/T13050.stderr
+++ b/testsuite/tests/typecheck/should_compile/T13050.stderr
@@ -1,8 +1,7 @@
T13050.hs:4:9: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int -> Int -> Int
- • In the expression: _
- In the expression: _ x y
+ • In the expression: _ x y
In an equation for ‘f’: f x y = _ x y
• Relevant bindings include
y :: Int (bound at T13050.hs:4:5)
diff --git a/testsuite/tests/typecheck/should_compile/T9404b.hs b/testsuite/tests/typecheck/should_compile/T9404b.hs
index f9db0a3897..2fe837f70e 100644
--- a/testsuite/tests/typecheck/should_compile/T9404b.hs
+++ b/testsuite/tests/typecheck/should_compile/T9404b.hs
@@ -11,5 +11,5 @@ bar _ = ()
myconst :: ((forall r. ListTF r -> Int) -> ()) -> x -> (forall r. ListTF r -> Int) -> ()
myconst x _ = x
-foo = (bar `myconst` ()) $ length
+foo = (bar `myconst` ()) $ length
foo2 = (myconst bar ()) $ length
diff --git a/testsuite/tests/typecheck/should_compile/T9497a.stderr b/testsuite/tests/typecheck/should_compile/T9497a.stderr
index d24849df79..114a7046ca 100644
--- a/testsuite/tests/typecheck/should_compile/T9497a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9497a.stderr
@@ -2,8 +2,7 @@
T9497a.hs:2:8: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
- • In the expression: _main
- In an equation for ‘main’: main = _main
+ • In an equation for ‘main’: main = _main
• Relevant bindings include main :: IO () (bound at T9497a.hs:2:1)
Valid hole fits include
main :: IO () (bound at T9497a.hs:2:1)
diff --git a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
index 8182d7c992..57214ba181 100644
--- a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
@@ -1,8 +1,7 @@
abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [Integer] -> Integer
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include
f :: [Integer] -> Integer
(bound at abstract_refinement_hole_fits.hs:4:1)
@@ -125,8 +124,7 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Integer -> [Integer] -> Integer
- • In the expression: _
- In the expression: _ 0
+ • In the expression: _ 0
In an equation for ‘g’: g = _ 0
• Relevant bindings include
g :: [Integer] -> Integer
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 9e4e80dba8..a74a84f461 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -216,7 +216,7 @@ test('tc207', normal, compile, [''])
test('tc208', normal, compile, [''])
test('tc209', normal, compile, [''])
test('tc210', normal, compile, [''])
-test('tc211', normal, compile_fail, [''])
+test('tc211', normal, compile, [''])
test('tc212', normal, compile, [''])
test('tc213', normal, compile, [''])
test('tc214', normal, compile, [''])
@@ -364,7 +364,7 @@ test('T3108', normal, compile, [''])
test('T5792',normal, makefile_test, [])
-test('PolytypeDecomp', normal, compile, [''])
+test('PolytypeDecomp', normal, compile_fail, [''])
test('T6011', normal, compile, [''])
test('T6055', normal, compile, [''])
test('DfltProb1', normal, compile, ['-O'])
diff --git a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
index adb507ea92..ffc02228f2 100644
--- a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
@@ -5,8 +5,7 @@ constraint_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
g :: forall a. Ord a => [a] -> a
at constraint_hole_fits.hs:3:1-22
- • In the expression: _
- In an equation for ‘g’: g = _
+ • In an equation for ‘g’: g = _
• Relevant bindings include
g :: [a] -> a (bound at constraint_hole_fits.hs:4:1)
Constraints include Ord a (from constraint_hole_fits.hs:3:1-22)
diff --git a/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
index 851e92e5fd..eee461b708 100644
--- a/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
@@ -10,9 +10,9 @@ free_monad_hole_fits.hs:14:28: warning: [-Wtyped-holes (in -Wdefault)]
the instance declaration
at free_monad_hole_fits.hs:10:10-38
Or perhaps ‘_a’ is mis-spelled, or not in scope
- • In the expression: _a
- In the first argument of ‘Free’, namely ‘(_a go fa)’
+ • In the first argument of ‘Free’, namely ‘(_a go fa)’
In the expression: Free (_a go fa)
+ In an equation for ‘go’: go (Free fa) = Free (_a go fa)
• Relevant bindings include
fa :: f (Free f a) (bound at free_monad_hole_fits.hs:14:16)
go :: Free f a -> Free f b (bound at free_monad_hole_fits.hs:12:7)
diff --git a/testsuite/tests/typecheck/should_compile/hole_constraints.stderr b/testsuite/tests/typecheck/should_compile/hole_constraints.stderr
index c1796aad12..2e32b1b92a 100644
--- a/testsuite/tests/typecheck/should_compile/hole_constraints.stderr
+++ b/testsuite/tests/typecheck/should_compile/hole_constraints.stderr
@@ -5,8 +5,7 @@ hole_constraints.hs:8:6: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
f1 :: forall a. Eq a => a
at hole_constraints.hs:7:1-15
- • In the expression: _
- In an equation for ‘f1’: f1 = _
+ • In an equation for ‘f1’: f1 = _
• Relevant bindings include
f1 :: a (bound at hole_constraints.hs:8:1)
Constraints include Eq a (from hole_constraints.hs:7:1-15)
@@ -18,8 +17,7 @@ hole_constraints.hs:12:6: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
f2 :: forall a. (Show a, Eq a) => a
at hole_constraints.hs:11:1-25
- • In the expression: _
- In an equation for ‘f2’: f2 = _
+ • In an equation for ‘f2’: f2 = _
• Relevant bindings include
f2 :: a (bound at hole_constraints.hs:12:1)
Constraints include
@@ -34,8 +32,7 @@ hole_constraints.hs:16:35: warning: [-Wtyped-holes (in -Wdefault)]
Where: ‘a’ is a rigid type variable bound by
the instance declaration
at hole_constraints.hs:16:10-22
- • In the expression: _
- In an equation for ‘f3’: f3 = _
+ • In an equation for ‘f3’: f3 = _
In the instance declaration for ‘C [a]’
• Relevant bindings include
f3 :: [a] (bound at hole_constraints.hs:16:30)
@@ -52,8 +49,7 @@ hole_constraints.hs:20:19: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
castWith :: forall a b. (a :~: b) -> a -> b
at hole_constraints.hs:19:1-29
- • In the expression: _
- In an equation for ‘castWith’: castWith Refl x = _
+ • In an equation for ‘castWith’: castWith Refl x = _
• Relevant bindings include
x :: a (bound at hole_constraints.hs:20:15)
castWith :: (a :~: b) -> a -> b (bound at hole_constraints.hs:20:1)
@@ -62,9 +58,9 @@ hole_constraints.hs:20:19: warning: [-Wtyped-holes (in -Wdefault)]
hole_constraints.hs:27:32: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: String
- • In the expression: _
- In a case alternative: AnyShow x -> _
+ • In a case alternative: AnyShow x -> _
In the expression: case a of { AnyShow x -> _ }
+ In an equation for ‘foo’: foo a = case a of { AnyShow x -> _ }
• Relevant bindings include
x :: a (bound at hole_constraints.hs:27:27)
a :: AnyShow (bound at hole_constraints.hs:27:5)
diff --git a/testsuite/tests/typecheck/should_compile/hole_constraints_nested.stderr b/testsuite/tests/typecheck/should_compile/hole_constraints_nested.stderr
index 46c0c22a34..6ca50b65b4 100644
--- a/testsuite/tests/typecheck/should_compile/hole_constraints_nested.stderr
+++ b/testsuite/tests/typecheck/should_compile/hole_constraints_nested.stderr
@@ -1,9 +1,9 @@
hole_constraints_nested.hs:12:16: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int
- • In the expression: _
- In a case alternative: EqOrd -> _
+ • In a case alternative: EqOrd -> _
In the expression: case d2 of { EqOrd -> _ }
+ In a case alternative: Refl -> case d2 of { EqOrd -> _ }
• Relevant bindings include
d2 :: EqOrd a (bound at hole_constraints_nested.hs:9:6)
d1 :: a :~: b (bound at hole_constraints_nested.hs:9:3)
diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index 77a6fc9a40..a4f106ab82 100644
--- a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ -4,15 +4,13 @@ holes.hs:3:5: warning: [-Wtyped-holes (in -Wdefault)]
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 = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: t (bound at holes.hs:3:1)
Valid hole fits include f :: forall {t}. t
holes.hs:6:7: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Char
- • In the expression: _
- In an equation for ‘g’: g x = _
+ • 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)
diff --git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr
index 874fd4459f..2210fc5dea 100644
--- a/testsuite/tests/typecheck/should_compile/holes3.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes3.stderr
@@ -4,16 +4,14 @@ holes3.hs:3:5: error:
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 = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include f :: t (bound at holes3.hs:3:1)
Valid hole fits include f :: forall {t}. t
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
+ • 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)
diff --git a/testsuite/tests/typecheck/should_compile/local_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/local_hole_fits.stderr
index 5485d05bef..2cf85f3c1e 100644
--- a/testsuite/tests/typecheck/should_compile/local_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/local_hole_fits.stderr
@@ -5,8 +5,7 @@ local_hole_fits.hs:4:15: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
head :: forall a. [a] -> a
at local_hole_fits.hs:3:1-16
- • In the expression: _
- In an equation for ‘head’: head (x : xs) = _
+ • In an equation for ‘head’: head (x : xs) = _
• Relevant bindings include
xs :: [a] (bound at local_hole_fits.hs:4:9)
x :: a (bound at local_hole_fits.hs:4:7)
@@ -19,8 +18,7 @@ local_hole_fits.hs:8:11: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
mshow :: forall a. Show a => a -> a
at local_hole_fits.hs:7:1-25
- • In the expression: _
- In an equation for ‘mshow’: mshow a = _
+ • In an equation for ‘mshow’: mshow a = _
• Relevant bindings include
a :: a (bound at local_hole_fits.hs:8:7)
mshow :: a -> a (bound at local_hole_fits.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
index 9e97fb51ff..9ed1615215 100644
--- a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
@@ -1,8 +1,7 @@
refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [Integer] -> Integer
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include
f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
Valid hole fits include
@@ -114,8 +113,7 @@ refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Integer -> [Integer] -> Integer
- • In the expression: _
- In the expression: _ 0
+ • In the expression: _ 0
In an equation for ‘g’: g = _ 0
• Relevant bindings include
g :: [Integer] -> Integer (bound at refinement_hole_fits.hs:7:1)
diff --git a/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
index 6007ab4d0b..7799aad239 100644
--- a/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
@@ -1,8 +1,7 @@
subsumption_sort_hole_fits.hs:2:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: String -> [String]
- • In the expression: _
- In the expression: _ "hello, world"
+ • In the expression: _ "hello, world"
In an equation for ‘f’: f = _ "hello, world"
• Relevant bindings include
f :: [String] (bound at subsumption_sort_hole_fits.hs:2:1)
diff --git a/testsuite/tests/typecheck/should_compile/tc211.hs b/testsuite/tests/typecheck/should_compile/tc211.hs
index e132cd8c80..0e23ed1640 100644
--- a/testsuite/tests/typecheck/should_compile/tc211.hs
+++ b/testsuite/tests/typecheck/should_compile/tc211.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -XImpredicativeTypes -fno-warn-deprecated-flags -XScopedTypeVariables -XGADTs #-}
+{-# LANGUAGE ImpredicativeTypes, ScopedTypeVariables, GADTs #-}
-- Nov 2014: impredicative types are very dodgy so I am
-- FAR from confident that these tests give the right errors
diff --git a/testsuite/tests/typecheck/should_compile/tc211.stderr b/testsuite/tests/typecheck/should_compile/tc211.stderr
deleted file mode 100644
index bbffa16943..0000000000
--- a/testsuite/tests/typecheck/should_compile/tc211.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-
-tc211.hs:21:17: error:
- • Couldn't match expected type: a -> a
- with actual type: forall a. a -> a
- • In the first argument of ‘(:) ::
- (forall a. a -> a)
- -> [forall a. a -> a] -> [forall a. a -> a]’, namely
- ‘(head foo)’
- In the expression:
- ((:) ::
- (forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a])
- (head foo) foo
- In an equation for ‘bar’:
- bar
- = ((:) ::
- (forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a])
- (head foo) foo
diff --git a/testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
index 4757d4915c..9f96ea3505 100644
--- a/testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
@@ -3,8 +3,7 @@ type_in_type_hole_fits.hs:79:11: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole:
_a :: [Integer] -> Sorted (O ('NLogN 2 0)) (O N) 'True Integer
Or perhaps ‘_a’ is mis-spelled, or not in scope
- • In the expression: _a
- In the expression: _a [3, 1, 2]
+ • In the expression: _a [3, 1, 2]
In an equation for ‘mySortA’: mySortA = _a [3, 1, 2]
• Relevant bindings include
mySortA :: Sorted (O (N ^. 2)) (O N) 'True Integer
@@ -32,8 +31,7 @@ type_in_type_hole_fits.hs:82:11: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole:
_b :: [Integer] -> Sorted (O ('NLogN 1 1)) (O N) 'False Integer
Or perhaps ‘_b’ is mis-spelled, or not in scope
- • In the expression: _b
- In the expression: _b [3, 1, 2]
+ • In the expression: _b [3, 1, 2]
In an equation for ‘mySortB’: mySortB = _b [3, 1, 2]
• Relevant bindings include
mySortB :: Sorted (O (N *. LogN)) (O N) 'False Integer
@@ -65,8 +63,7 @@ type_in_type_hole_fits.hs:85:11: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole:
_c :: [Integer] -> Sorted (O ('NLogN 1 1)) (O One) 'False Integer
Or perhaps ‘_c’ is mis-spelled, or not in scope
- • In the expression: _c
- In the expression: _c [3, 1, 2]
+ • In the expression: _c [3, 1, 2]
In an equation for ‘mySortC’: mySortC = _c [3, 1, 2]
• Relevant bindings include
mySortC :: Sorted (O (N *. LogN)) (O One) 'False Integer
diff --git a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
index 116a18f42f..5830ecb7d7 100644
--- a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
@@ -11,12 +11,16 @@ valid_hole_fits.hs:9:6: warning: [-Wdeferred-out-of-scope-variables (in -Wdefaul
valid_hole_fits.hs:17:17: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Int -> IO Int
- • In the expression: _
- In a stmt of a 'do' block: y <- _ x
+ • In a stmt of a 'do' block: y <- _ x
In the expression:
do x <- a 0
y <- _ x
return y
+ In an equation for ‘c’:
+ c _
+ = do x <- a 0
+ y <- _ x
+ return y
• Relevant bindings include
x :: Int (bound at valid_hole_fits.hs:16:12)
c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
@@ -39,8 +43,7 @@ valid_hole_fits.hs:21:8: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
test :: forall a. [Maybe a] -> [a]
at valid_hole_fits.hs:20:1-24
- • In the expression: _
- In an equation for ‘test’: test = _
+ • In an equation for ‘test’: test = _
• Relevant bindings include
test :: [Maybe a] -> [a] (bound at valid_hole_fits.hs:21:1)
Valid hole fits include
@@ -55,8 +58,7 @@ valid_hole_fits.hs:21:8: warning: [-Wtyped-holes (in -Wdefault)]
valid_hole_fits.hs:24:9: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Integer -> ValidHoleFits.Moo
- • In the expression: _
- In an equation for ‘test2’: test2 = _
+ • In an equation for ‘test2’: test2 = _
• Relevant bindings include
test2 :: Integer -> ValidHoleFits.Moo
(bound at valid_hole_fits.hs:24:1)
@@ -70,8 +72,7 @@ valid_hole_fits.hs:24:9: warning: [-Wtyped-holes (in -Wdefault)]
valid_hole_fits.hs:27:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: t0 -> Maybe Integer
Where: ‘t0’ is an ambiguous type variable
- • In the expression: _
- In the expression: _ 2
+ • In the expression: _ 2
In an equation for ‘k’: k = _ 2
• Relevant bindings include
k :: Maybe Integer (bound at valid_hole_fits.hs:27:1)
@@ -128,9 +129,9 @@ valid_hole_fits.hs:30:10: warning: [-Wtyped-holes (in -Wdefault)]
valid_hole_fits.hs:34:11: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Bool -> a0
Where: ‘a0’ is an ambiguous type variable
- • In the expression: _
- In the first argument of ‘show’, namely ‘(_ (_ :: Bool))’
+ • In the first argument of ‘show’, namely ‘(_ (_ :: Bool))’
In the expression: show (_ (_ :: Bool))
+ In an equation for ‘h’: h = show (_ (_ :: Bool))
• Relevant bindings include
h :: String (bound at valid_hole_fits.hs:34:1)
Valid hole fits include
@@ -202,8 +203,7 @@ valid_hole_fits.hs:38:10: warning: [-Wtyped-holes (in -Wdefault)]
the type signature for:
myCons :: forall a. a -> [a] -> [a]
at valid_hole_fits.hs:37:1-25
- • In the expression: _
- In an equation for ‘myCons’: myCons = _
+ • In an equation for ‘myCons’: myCons = _
• Relevant bindings include
myCons :: a -> [a] -> [a] (bound at valid_hole_fits.hs:38:1)
Valid hole fits include
@@ -226,8 +226,7 @@ valid_hole_fits.hs:38:10: warning: [-Wtyped-holes (in -Wdefault)]
valid_hole_fits.hs:41:8: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: String -> IO ()
- • In the expression: _
- In the expression: _ "hello, world"
+ • In the expression: _ "hello, world"
In an equation for ‘main’: main = _ "hello, world"
• Relevant bindings include
main :: IO () (bound at valid_hole_fits.hs:41:1)
diff --git a/testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr b/testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
index ac4fdc94c7..90f7943f09 100644
--- a/testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
+++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
@@ -1,8 +1,7 @@
valid_hole_fits_interactions.hs:15:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: SBool 'True
- • In the expression: _
- In an equation for ‘f’: f = _
+ • In an equation for ‘f’: f = _
• Relevant bindings include
f :: SBool 'True (bound at valid_hole_fits_interactions.hs:15:1)
Valid hole fits include
diff --git a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
index 255b3ad702..6345e2ab1c 100644
--- a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
+++ b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
@@ -1,6 +1,9 @@
FrozenErrorTests.hs:26:9: error:
• Couldn't match type ‘a’ with ‘[a]’ arising from a use of ‘goo1’
+ ‘a’ is a rigid type variable bound by
+ the inferred type of test1 :: a
+ at FrozenErrorTests.hs:26:1-28
• In the expression: goo1 False undefined
In an equation for ‘test1’: test1 = goo1 False undefined
• Relevant bindings include
diff --git a/testsuite/tests/typecheck/should_fail/T12177.stderr b/testsuite/tests/typecheck/should_fail/T12177.stderr
index 0c810f4185..16056e3e27 100644
--- a/testsuite/tests/typecheck/should_fail/T12177.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12177.stderr
@@ -4,9 +4,9 @@ T12177.hs:3:19: error:
Where: ‘t’ is a rigid type variable bound by
the inferred type of bar :: p -> p1 -> t
at T12177.hs:3:1-19
- • In the expression: _
- In the expression: \ x -> _
+ • In the expression: \ x -> _
In the expression: \ x -> \ x -> _
+ In an equation for ‘bar’: bar = \ x -> \ x -> _
• Relevant bindings include
x :: p1 (bound at T12177.hs:3:14)
bar :: p -> p1 -> t (bound at T12177.hs:3:1)
@@ -16,9 +16,9 @@ T12177.hs:5:37: error:
Where: ‘t’ is a rigid type variable bound by
the inferred type of baz :: p -> p1 -> p2 -> p3 -> p4 -> t
at T12177.hs:5:1-37
- • In the expression: _
- In the expression: \ z -> _
+ • In the expression: \ z -> _
In the expression: \ x -> \ z -> _
+ In the expression: \ z -> \ x -> \ z -> ...
• Relevant bindings include
z :: p4 (bound at T12177.hs:5:32)
x :: p3 (bound at T12177.hs:5:26)
diff --git a/testsuite/tests/typecheck/should_fail/T14884.stderr b/testsuite/tests/typecheck/should_fail/T14884.stderr
index e1738891a7..c901811f6f 100644
--- a/testsuite/tests/typecheck/should_fail/T14884.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14884.stderr
@@ -2,8 +2,7 @@
T14884.hs:4:5: error:
• Found hole: _ :: (a0 -> IO ()) -> String -> IO ()
Where: ‘a0’ is an ambiguous type variable
- • In the expression: _
- In the expression: _ print "abc"
+ • In the expression: _ print "abc"
In an equation for ‘x’: x = _ print "abc"
• Relevant bindings include x :: IO () (bound at T14884.hs:4:1)
Valid hole fits include
diff --git a/testsuite/tests/typecheck/should_fail/T14904a.stderr b/testsuite/tests/typecheck/should_fail/T14904a.stderr
index c0e2b84a80..3b8d005bab 100644
--- a/testsuite/tests/typecheck/should_fail/T14904a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14904a.stderr
@@ -1,7 +1,8 @@
T14904a.hs:9:6: error:
- • Expected kind ‘forall (a :: k1). g a’, but ‘f’ has kind ‘k0’
- Cannot instantiate unification variable ‘k0’
- with a kind involving polytypes: forall (a :: k1). g a
+ • Expected kind ‘forall (a :: k). g a’, but ‘f’ has kind ‘k1’
+ ‘k1’ is a rigid type variable bound by
+ a family instance declaration
+ at T14904a.hs:9:3-30
• In the first argument of ‘F’, namely ‘(f :: forall a. g a)’
In the type family declaration for ‘F’
diff --git a/testsuite/tests/typecheck/should_fail/T15799.stderr b/testsuite/tests/typecheck/should_fail/T15799.stderr
index f93e043471..4e6d7b4dfd 100644
--- a/testsuite/tests/typecheck/should_fail/T15799.stderr
+++ b/testsuite/tests/typecheck/should_fail/T15799.stderr
@@ -2,6 +2,3 @@
T15799.hs:46:62: error:
• Expected kind ‘Op Nat’, but ‘UnOp b’ has kind ‘Nat’
• In the first argument of ‘(<=)’, namely ‘UnOp b’
-
-T15799.hs:46:62: error:
- Expected a constraint, but ‘UnOp b <= a’ has kind ‘*’
diff --git a/testsuite/tests/typecheck/should_fail/T15807.stderr b/testsuite/tests/typecheck/should_fail/T15807.stderr
index 809398ade0..bac4b5596e 100644
--- a/testsuite/tests/typecheck/should_fail/T15807.stderr
+++ b/testsuite/tests/typecheck/should_fail/T15807.stderr
@@ -1,6 +1,9 @@
-T15807.hs:12:12: error:
- • Expected kind ‘f -> *’, but ‘f’ has kind ‘*’
- • In the type ‘f a’
- In the definition of data constructor ‘MkApp’
+T15807.hs:12:3: error:
+ • Cannot generalise type; skolem ‘f’ would escape its scope
+ if I tried to quantify (f0 :: f -> *) in this type:
+ forall f (a :: f). f a #-> App @f @f0 a
+ (Indeed, I sometimes struggle even printing this correctly,
+ due to its ill-scoped nature.)
+ • In the definition of data constructor ‘MkApp’
In the data declaration for ‘App’
diff --git a/testsuite/tests/typecheck/should_fail/T15862.stderr b/testsuite/tests/typecheck/should_fail/T15862.stderr
index 97fbfab166..aeb0f73b9b 100644
--- a/testsuite/tests/typecheck/should_fail/T15862.stderr
+++ b/testsuite/tests/typecheck/should_fail/T15862.stderr
@@ -1,28 +1,7 @@
-T15862.hs:17:7: error:
- • No instance for (Typeable 'MkFoo) arising from a use of ‘typeRep’
- GHC can't yet do polykinded
- Typeable ('MkFoo :: (forall a. a) -> Foo)
- • In the expression: typeRep @MkFoo
- In an equation for ‘foo’: foo = typeRep @MkFoo
-
-T15862.hs:25:7: error:
- • No instance for (Typeable 'MkBar) arising from a use of ‘typeRep’
- GHC can't yet do polykinded Typeable ('MkBar :: Bool -> Bar)
- • In the expression: typeRep
- In an equation for ‘bar’: bar = typeRep
-
-T15862.hs:30:8: error:
- • No instance for (Typeable 'MkQuux)
- arising from a use of ‘typeRep’
- GHC can't yet do polykinded
- Typeable ('MkQuux :: (# Bool | Int #) -> Quux)
- • In the expression: typeRep
- In an equation for ‘quux’: quux = typeRep
-
-T15862.hs:36:8: error:
- • No instance for (Typeable 'MkQuuz)
- arising from a use of ‘typeRep’
- GHC can't yet do polykinded Typeable ('MkQuuz :: Quuz)
- • In the expression: typeRep
- In an equation for ‘quuz’: quuz = typeRep
+T15862.hs:16:16: error:
+ • Expected kind ‘k0’, but ‘MkFoo’ has kind ‘(forall a. a) -> Foo’
+ Cannot instantiate unification variable ‘k0’
+ with a kind involving polytypes: (forall a. a) -> Foo
+ • In the first argument of ‘TypeRep’, namely ‘MkFoo’
+ In the type signature: foo :: TypeRep MkFoo
diff --git a/testsuite/tests/typecheck/should_fail/T15962.stderr b/testsuite/tests/typecheck/should_fail/T15962.stderr
index ffab68c98e..49dbb8ce96 100644
--- a/testsuite/tests/typecheck/should_fail/T15962.stderr
+++ b/testsuite/tests/typecheck/should_fail/T15962.stderr
@@ -1,18 +1,18 @@
-T15962.hs:27:11:
- Found hole: _ :: Big ks -> Big (Eval (Map Dual ks))
+
+T15962.hs:27:11: error:
+ • Found hole: _ :: Big ks -> Big (Eval (Map Dual ks))
Where: ‘ks’ is a rigid type variable bound by
the type signature for:
dualBig :: forall (ks :: [OpKind]).
Big ks -> Big (Eval (Map Dual ks))
at T15962.hs:26:1-45
- In the expression: _
- In an equation for ‘dualBig’: dualBig = _
- Relevant bindings include
+ • In an equation for ‘dualBig’: dualBig = _
+ • Relevant bindings include
dualBig :: Big ks -> Big (Eval (Map Dual ks))
(bound at T15962.hs:27:1)
Valid hole fits include
dualBig :: Big ks -> Big (Eval (Map Dual ks))
(bound at T15962.hs:27:1)
-T15962.hs:33:12:
+T15962.hs:33:12: error:
Variable not in scope: iDontExist :: Big ('Conjunction : ks)
diff --git a/testsuite/tests/typecheck/should_fail/T16456.stderr b/testsuite/tests/typecheck/should_fail/T16456.stderr
index fbc0cc6ed5..5e69b9352a 100644
--- a/testsuite/tests/typecheck/should_fail/T16456.stderr
+++ b/testsuite/tests/typecheck/should_fail/T16456.stderr
@@ -1,8 +1,7 @@
T16456.hs:7:7: error:
• Found hole: _ :: T Int
- • In the expression: _
- In an equation for ‘foo’: foo = _
+ • In an equation for ‘foo’: foo = _
• Relevant bindings include foo :: T Int (bound at T16456.hs:7:1)
Valid hole fits include
foo :: T Int (bound at T16456.hs:7:1)
diff --git a/testsuite/tests/typecheck/should_fail/T17773.stderr b/testsuite/tests/typecheck/should_fail/T17773.stderr
index 401fcc494a..22b3d5577e 100644
--- a/testsuite/tests/typecheck/should_fail/T17773.stderr
+++ b/testsuite/tests/typecheck/should_fail/T17773.stderr
@@ -8,8 +8,7 @@ T17773.hs:16:22: error:
Proxy x -> Proxy y -> Mzero x y :~: (x <|> y)
at T17773.hs:(13,1)-(15,41)
Or perhaps ‘_Refl’ is mis-spelled, or not in scope
- • In the expression: _Refl
- In an equation for ‘monadPlusMplus’: monadPlusMplus _ _ = _Refl
+ • In an equation for ‘monadPlusMplus’: monadPlusMplus _ _ = _Refl
• Relevant bindings include
monadPlusMplus :: Proxy x -> Proxy y -> Mzero x y :~: (x <|> y)
(bound at T17773.hs:16:1)
diff --git a/testsuite/tests/typecheck/should_fail/T18640a.hs b/testsuite/tests/typecheck/should_fail/T18640a.hs
new file mode 100644
index 0000000000..b208cfadaa
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640a.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+
+module T18640a where
+
+import Data.Kind
+
+type F2 :: forall a b. Type -> a
+type family F2 :: forall b. Type -> Type where
diff --git a/testsuite/tests/typecheck/should_fail/T18640a.stderr b/testsuite/tests/typecheck/should_fail/T18640a.stderr
new file mode 100644
index 0000000000..edc9a83c25
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640a.stderr
@@ -0,0 +1,9 @@
+
+T18640a.hs:11:1: error:
+ • Couldn't match kind ‘a’ with ‘*’
+ Expected: forall (b :: k). * -> *
+ Actual: forall (b :: k). * -> a
+ ‘a’ is a rigid type variable bound by
+ the type family declaration for ‘F2’
+ at T18640a.hs:10:19
+ • In the type family declaration for ‘F2’
diff --git a/testsuite/tests/typecheck/should_fail/T18640b.hs b/testsuite/tests/typecheck/should_fail/T18640b.hs
new file mode 100644
index 0000000000..f722805ca9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640b.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+
+module T18640b where
+
+import Data.Kind
+
+data family F1 (k :: Type) :: k
+
+type F3 :: forall (a :: Type) -> forall (b :: Type) -> a
+type family F3 a where
+ F3 a = F1
diff --git a/testsuite/tests/typecheck/should_fail/T18640b.stderr b/testsuite/tests/typecheck/should_fail/T18640b.stderr
new file mode 100644
index 0000000000..2a84295a73
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640b.stderr
@@ -0,0 +1,12 @@
+
+T18640b.hs:14:10: error:
+ • Couldn't match kind ‘k’ with ‘a’
+ Expected kind ‘forall b -> a’, but ‘F1’ has kind ‘forall k -> k’
+ ‘k’ is a rigid type variable bound by
+ the type k
+ at T18640b.hs:14:3-11
+ ‘a’ is a rigid type variable bound by
+ a family instance declaration
+ at T18640b.hs:14:6
+ • In the type ‘F1’
+ In the type family declaration for ‘F3’
diff --git a/testsuite/tests/typecheck/should_fail/T18640c.hs b/testsuite/tests/typecheck/should_fail/T18640c.hs
new file mode 100644
index 0000000000..eb6479cc3b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640c.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+
+module T18640c where
+
+import Data.Kind
+
+type F1 :: forall k -> Type
+type family F1 k :: Type
+
+type F2 :: forall x. forall k -> x
+type F2 = F1
diff --git a/testsuite/tests/typecheck/should_fail/T18640c.stderr b/testsuite/tests/typecheck/should_fail/T18640c.stderr
new file mode 100644
index 0000000000..447882717f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18640c.stderr
@@ -0,0 +1,10 @@
+
+T18640c.hs:14:11: error:
+ • Couldn't match kind ‘x’ with ‘*’
+ Expected kind ‘forall (k1 :: k) -> x’,
+ but ‘F1’ has kind ‘forall (k1 :: k) -> *’
+ ‘x’ is a rigid type variable bound by
+ the type synonym declaration for ‘F2’
+ at T18640c.hs:13:19
+ • In the type ‘F1’
+ In the type declaration for ‘F2’
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index eb84cba7b4..bd4aceed9e 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -1,5 +1,5 @@
-T1899.hs:14:36: error:
+T1899.hs:15:36: error:
• Couldn't match type ‘a’ with ‘Proposition a0’
Expected: [Proposition a0]
Actual: [a]
diff --git a/testsuite/tests/typecheck/should_fail/T2846b.hs b/testsuite/tests/typecheck/should_fail/T2846b.hs
index 87468df87e..07f24e7627 100644
--- a/testsuite/tests/typecheck/should_fail/T2846b.hs
+++ b/testsuite/tests/typecheck/should_fail/T2846b.hs
@@ -3,4 +3,6 @@ module T2846 where
f :: String
f = show ([1,2,3] :: [Num a => a])
-
+-- Rejected with Quick Look
+-- The arg of 'show' is a naked 'a'
+-- And the actual arg has type (forall a. [Num a => a]), which is polymorphic
diff --git a/testsuite/tests/typecheck/should_fail/T2846b.stderr b/testsuite/tests/typecheck/should_fail/T2846b.stderr
index 8c52fd7d33..95b30407f2 100644
--- a/testsuite/tests/typecheck/should_fail/T2846b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2846b.stderr
@@ -1,7 +1,10 @@
-T2846b.hs:5:5: error:
- • No instance for (Show (Num a0 => a0))
- arising from a use of ‘show’
- (maybe you haven't applied a function to enough arguments?)
- • In the expression: show ([1, 2, 3] :: [Num a => a])
+T2846b.hs:5:11: error:
+ • Couldn't match expected type ‘a1’
+ with actual type ‘[Num a0 => a0]’
+ Cannot instantiate unification variable ‘a1’
+ with a type involving polytypes: [Num a0 => a0]
+ • In the first argument of ‘show’, namely
+ ‘([1, 2, 3] :: [Num a => a])’
+ In the expression: show ([1, 2, 3] :: [Num a => a])
In an equation for ‘f’: f = show ([1, 2, 3] :: [Num a => a])
diff --git a/testsuite/tests/typecheck/should_fail/T5570.stderr b/testsuite/tests/typecheck/should_fail/T5570.stderr
index 710104012d..0c12be680e 100644
--- a/testsuite/tests/typecheck/should_fail/T5570.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5570.stderr
@@ -1,6 +1,6 @@
T5570.hs:7:16: error:
• Expecting a lifted type, but ‘Double#’ is unlifted
- • In the second argument of ‘($)’, namely ‘D# $ 3.0##’
+ • In the first argument of ‘($)’, namely ‘D#’
+ In the second argument of ‘($)’, namely ‘D# $ 3.0##’
In the expression: print $ D# $ 3.0##
- In an equation for ‘main’: main = print $ D# $ 3.0##
diff --git a/testsuite/tests/typecheck/should_fail/T6069.stderr b/testsuite/tests/typecheck/should_fail/T6069.stderr
index c70939fee5..ffad9a9534 100644
--- a/testsuite/tests/typecheck/should_fail/T6069.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6069.stderr
@@ -5,8 +5,8 @@ T6069.hs:13:15: error:
Expected: ST s0 Int -> b0
Actual: (forall s. ST s b0) -> b0
• In the second argument of ‘(.)’, namely ‘runST’
- In the expression: print . runST
In the expression: (print . runST) fourty_two
+ In an equation for ‘f1’: f1 = (print . runST) fourty_two
T6069.hs:14:15: error:
• Couldn't match type: forall s. ST s b1
diff --git a/testsuite/tests/typecheck/should_fail/T7734.stderr b/testsuite/tests/typecheck/should_fail/T7734.stderr
index bf199cb4c2..f47fd3b393 100644
--- a/testsuite/tests/typecheck/should_fail/T7734.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7734.stderr
@@ -1,6 +1,9 @@
T7734.hs:4:13: error:
• Couldn't match expected type ‘t’ with actual type ‘t -> t1’
+ ‘t’ is a rigid type variable bound by
+ the inferred type of f :: (t -> t1) -> p -> t1
+ at T7734.hs:4:1-13
• In the first argument of ‘x’, namely ‘x’
In the expression: x x
In an equation for ‘f’: x `f` y = x x
@@ -10,6 +13,9 @@ T7734.hs:4:13: error:
T7734.hs:5:13: error:
• Couldn't match expected type ‘t’ with actual type ‘t -> t1’
+ ‘t’ is a rigid type variable bound by
+ the inferred type of & :: (t -> t1) -> p -> t1
+ at T7734.hs:5:1-13
• In the first argument of ‘x’, namely ‘x’
In the expression: x x
In an equation for ‘&’: (&) x y = x x
diff --git a/testsuite/tests/typecheck/should_fail/T8450.stderr b/testsuite/tests/typecheck/should_fail/T8450.stderr
index a75d0703c6..9ac0d63643 100644
--- a/testsuite/tests/typecheck/should_fail/T8450.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8450.stderr
@@ -1,5 +1,5 @@
-T8450.hs:8:20: error:
+T8450.hs:8:19: error:
• Couldn't match type ‘a’ with ‘Bool’
Expected: Either Bool ()
Actual: Either a ()
diff --git a/testsuite/tests/typecheck/should_fail/T8570.stderr b/testsuite/tests/typecheck/should_fail/T8570.stderr
index d79ea6581f..183001b577 100644
--- a/testsuite/tests/typecheck/should_fail/T8570.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8570.stderr
@@ -1,10 +1,4 @@
-T8570.hs:6:11: error:
- • Couldn't match expected type ‘Image’ with actual type ‘Field’
- • In the pattern: Image {filepath = x}
- In a pattern binding: Image {filepath = x} = logo
- In the expression: let Image {filepath = x} = logo in x
-
T8570.hs:6:18: error:
• Constructor ‘Image’ does not have field ‘filepath’
• In the pattern: Image {filepath = x}
diff --git a/testsuite/tests/typecheck/should_fail/T8603.stderr b/testsuite/tests/typecheck/should_fail/T8603.stderr
index 4776253f52..e202ca2610 100644
--- a/testsuite/tests/typecheck/should_fail/T8603.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8603.stderr
@@ -1,15 +1,29 @@
T8603.hs:33:17: error:
- • Couldn't match type: RV a1
- with: StateT s RV a0
+ • Couldn't match kind ‘*’ with ‘* -> *’
+ When matching types
+ (->) [a1] :: * -> *
+ [a2] :: *
Expected: [a2] -> StateT s RV a0
- Actual: t0 ((->) [a1]) (RV a1)
+ Actual: t0 ((->) [a1]) (StateT s RV a0)
• The function ‘lift’ is applied to two value arguments,
- but its type ‘([a1] -> RV a1) -> t0 ((->) [a1]) (RV a1)’
+ but its type ‘([a1] -> StateT s RV a0)
+ -> t0 ((->) [a1]) (StateT s RV a0)’
has only one
In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
In the expression:
do prize <- lift uniform [1, 2, ....]
return False
+
+T8603.hs:33:22: error:
+ • Couldn't match type: RV a1
+ with: StateT s RV a0
+ Expected: [a1] -> StateT s RV a0
+ Actual: [a1] -> RV a1
+ • In the first argument of ‘lift’, namely ‘uniform’
+ In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
+ In the expression:
+ do prize <- lift uniform [1, 2, ....]
+ return False
• Relevant bindings include
testRVState1 :: RVState s Bool (bound at T8603.hs:32:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9109.stderr b/testsuite/tests/typecheck/should_fail/T9109.stderr
index f30c49bde6..6a4d4988de 100644
--- a/testsuite/tests/typecheck/should_fail/T9109.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9109.stderr
@@ -1,13 +1,13 @@
T9109.hs:8:13: error:
- • Couldn't match expected type ‘p’ with actual type ‘Bool’
- ‘p’ is untouchable
- inside the constraints: a ~ Bool
- bound by a pattern with constructor: GBool :: G Bool,
- in an equation for ‘foo’
- at T9109.hs:8:5-9
+ • Could not deduce: p ~ Bool
+ from the context: a ~ Bool
+ bound by a pattern with constructor: GBool :: G Bool,
+ in an equation for ‘foo’
+ at T9109.hs:8:5-9
‘p’ is a rigid type variable bound by
- the inferred type of foo :: G a -> p at T9109.hs:8:1-16
+ the inferred type of foo :: G a -> p
+ 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
diff --git a/testsuite/tests/typecheck/should_fail/T9497d.stderr b/testsuite/tests/typecheck/should_fail/T9497d.stderr
index fff9e2e6a8..42da4bf430 100644
--- a/testsuite/tests/typecheck/should_fail/T9497d.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9497d.stderr
@@ -2,8 +2,7 @@
T9497d.hs:2:8: error:
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
- • In the expression: _main
- In an equation for ‘main’: main = _main
+ • In an equation for ‘main’: main = _main
• Relevant bindings include main :: IO () (bound at T9497d.hs:2:1)
Valid hole fits include
main :: IO () (bound at T9497d.hs:2:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9858e.stderr b/testsuite/tests/typecheck/should_fail/T9858e.stderr
index f397723a02..0ea9d4736a 100644
--- a/testsuite/tests/typecheck/should_fail/T9858e.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9858e.stderr
@@ -1,5 +1,5 @@
-T9858e.hs:9:8: error:
+T9858e.hs:9:7: error:
• Couldn't match type: Eq Int => Int
with: a0 b0
Expected: Proxy (a0 b0)
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 6b10777f12..bc325be674 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -580,3 +580,7 @@ test('T18357b', normal, compile_fail, [''])
test('T18455', normal, compile_fail, [''])
test('T18534', normal, compile_fail, [''])
test('T18714', normal, compile_fail, [''])
+test('too-many', normal, compile_fail, [''])
+test('T18640a', normal, compile_fail, [''])
+test('T18640b', normal, compile_fail, [''])
+test('T18640c', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/tcfail002.stderr b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
index 7de2d04c08..4e14032d62 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail002.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
@@ -1,6 +1,9 @@
tcfail002.hs:4:7: error:
• Couldn't match expected type ‘a’ with actual type ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ the inferred type of c :: [a] -> a
+ at tcfail002.hs:(3,1)-(4,7)
• In the expression: z
In an equation for ‘c’: c z = z
• Relevant bindings include
diff --git a/testsuite/tests/typecheck/should_fail/tcfail014.stderr b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
index 65b217ef1f..5525e01510 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail014.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
@@ -1,6 +1,9 @@
tcfail014.hs:5:33: error:
• Couldn't match expected type ‘t4’ with actual type ‘t4 -> t5’
+ ‘t4’ is a rigid type variable bound by
+ the inferred type of h :: (t4 -> t5) -> t5
+ at tcfail014.hs:5:25-33
• In the first argument of ‘z’, namely ‘z’
In the expression: z z
In an equation for ‘h’: h z = z z
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index a09941d284..bb7eafc6fb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -1,11 +1,9 @@
tcfail032.hs:14:8: error:
• Couldn't match expected type ‘a1 -> Int’ with actual type ‘p’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature:
- forall a1. Eq a1 => a1 -> Int
- at tcfail032.hs:14:13-30
+ ‘p’ is a rigid type variable bound by
+ the inferred type of f :: Eq a => p -> a -> Int
+ at tcfail032.hs:14:1-31
• In the expression: x :: (Eq a) => a -> Int
In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
• Relevant bindings include
diff --git a/testsuite/tests/typecheck/should_fail/tcfail033.stderr b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
index a1c5e7d7d0..2b2089d8ec 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail033.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
@@ -1,6 +1,9 @@
tcfail033.hs:4:12: error:
• Couldn't match expected type ‘(a, b)’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the inferred type of buglet :: [(a, b)]
+ at tcfail033.hs:4:1-32
• In the expression: x
In the expression: [x | (x, y) <- buglet]
In an equation for ‘buglet’: buglet = [x | (x, y) <- buglet]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index 8de86280e1..4e1ced2fc9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ -9,7 +9,7 @@ tcfail140.hs:10:7: error:
tcfail140.hs:12:10: error:
• Couldn't match expected type ‘t1 -> t’ with actual type ‘Int’
- • The operator ‘f’ takes two value arguments,
+ • The function ‘f’ is applied to two value arguments,
but its type ‘Int -> Int’ has only one
In the expression: 3 `f` 4
In an equation for ‘rot’: rot xs = 3 `f` 4
@@ -19,7 +19,7 @@ tcfail140.hs:12:10: error:
tcfail140.hs:14:15: error:
• Couldn't match expected type ‘a -> b’ with actual type ‘Int’
• The operator ‘f’ takes two value arguments,
- but its type ‘Int -> Int’ has only one
+ but its type ‘Int -> Int’ has only one
In the first argument of ‘map’, namely ‘(3 `f`)’
In the expression: map (3 `f`) xs
• Relevant bindings include
diff --git a/testsuite/tests/typecheck/should_fail/tcfail165.stderr b/testsuite/tests/typecheck/should_fail/tcfail165.stderr
index b1f173f447..ecbec54fb5 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail165.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail165.stderr
@@ -1,12 +1,17 @@
-tcfail165.hs:19:23: error:
- • Couldn't match expected type: forall a. Show a => a -> String
- with actual type: b0 -> String
- • In the second argument of ‘putMVar’, namely
- ‘(show :: forall b. Show b => b -> String)’
- In a stmt of a 'do' block:
- putMVar var (show :: forall b. Show b => b -> String)
+tcfail165.hs:18:17: error:
+ • Couldn't match type: forall a. Show a => a -> String
+ with: b0 -> String
+ Expected: IO (MVar (b0 -> String))
+ Actual: IO (MVar (forall a. Show a => a -> String))
+ • In a stmt of a 'do' block:
+ var <- newEmptyMVar :: IO (MVar (forall a. Show a => a -> String))
In the expression:
do var <- newEmptyMVar ::
IO (MVar (forall a. Show a => a -> String))
putMVar var (show :: forall b. Show b => b -> String)
+ In an equation for ‘foo’:
+ foo
+ = do var <- newEmptyMVar ::
+ IO (MVar (forall a. Show a => a -> String))
+ putMVar var (show :: forall b. Show b => b -> String)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.hs b/testsuite/tests/typecheck/should_fail/tcfail174.hs
index c3328ea4e7..226a9ee36e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.hs
@@ -6,12 +6,16 @@ data Capture a = Base a
| Capture (Capture (forall x . x -> a))
g :: Capture (forall a . a -> a)
-g = Base id -- Fails; need a rigid signature on 'id'
+g = Base id
+ -- Fails; need a rigid signature on 'id'
-- Actually, succeeds now, with visible type application
-- Disagree: should not succeed because it instantiates
-- Base with a forall type
+ -- May 20: succeeds with Quick Look
--- This function should definitely be rejected, with or without type signature
+
+-- h should definitely be rejected,
+-- with (h2) or without (h1) type signature
h1 = Capture g
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index 5747a270ef..8ac8d3f9d5 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ -1,29 +1,21 @@
-tcfail174.hs:9:5: error:
- • Couldn't match type: a0 -> a0
- with: forall a. a -> a
- Expected: Capture (forall a. a -> a)
- Actual: Capture (a0 -> a0)
- • In the expression: Base id
- In an equation for ‘g’: g = Base id
-
-tcfail174.hs:16:14: error:
+tcfail174.hs:20:14: error:
• Couldn't match type ‘a1’ with ‘a’
Expected: Capture (forall x. x -> a)
Actual: Capture (forall a. a -> a)
‘a1’ is a rigid type variable bound by
the type a -> a
- at tcfail174.hs:16:1-14
+ at tcfail174.hs:20:1-14
‘a’ is a rigid type variable bound by
the inferred type of h1 :: Capture a
- at tcfail174.hs:16:1-14
+ at tcfail174.hs:20:1-14
• 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:16:1)
+ h1 :: Capture a (bound at tcfail174.hs:20:1)
-tcfail174.hs:19:14: error:
+tcfail174.hs:23:14: error:
• Couldn't match type ‘a’ with ‘b’
Expected: Capture (forall x. x -> b)
Actual: Capture (forall a. a -> a)
@@ -33,9 +25,9 @@ tcfail174.hs:19:14: error:
‘b’ is a rigid type variable bound by
the type signature for:
h2 :: forall b. Capture b
- at tcfail174.hs:18:1-15
+ at tcfail174.hs:22:1-15
• 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:19:1)
+ h2 :: Capture b (bound at tcfail174.hs:23:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail204.stderr b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
index 8083ffce60..a1ab99c445 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail204.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
@@ -2,7 +2,7 @@
tcfail204.hs:10:7: error: [-Wtype-defaults (in -Wall), -Werror=type-defaults]
• Defaulting the following constraints to type ‘Double’
(RealFrac a0)
- arising from a use of ‘ceiling’ at tcfail204.hs:10:7-17
+ arising from a use of ‘ceiling’ at tcfail204.hs:10:7-13
(Fractional a0)
arising from the literal ‘6.3’ at tcfail204.hs:10:15-17
• In the expression: ceiling 6.3
diff --git a/testsuite/tests/typecheck/should_fail/tcfail218.stderr b/testsuite/tests/typecheck/should_fail/tcfail218.stderr
index efb6c4c9d3..f591b09b2a 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail218.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail218.stderr
@@ -1,11 +1,11 @@
-tcfail218.hs:16:5:
- Overlapping instances for C [a] Bool arising from a use of ‘foo’
- Matching instances:
- instance C [a] b -- Defined at tcfail218.hs:8:29
- instance C [Int] Bool -- Defined at tcfail218.hs:7:29
- (The choice depends on the instantiation of ‘a’
- To pick the first instance above, use IncoherentInstances
- when compiling the other instance declarations)
- In the expression: foo
- In an equation for ‘x’: x = foo
+tcfail218.hs:16:5: error:
+ • Overlapping instances for C [a] Bool arising from a use of ‘foo’
+ Matching instances:
+ instance C [a] b -- Defined at tcfail218.hs:8:29
+ instance C [Int] Bool -- Defined at tcfail218.hs:7:29
+ (The choice depends on the instantiation of ‘a’
+ To pick the first instance above, use IncoherentInstances
+ when compiling the other instance declarations)
+ • In the expression: foo
+ In an equation for ‘x’: x = foo
diff --git a/testsuite/tests/typecheck/should_fail/too-many.hs b/testsuite/tests/typecheck/should_fail/too-many.hs
new file mode 100644
index 0000000000..e3a4e2ba04
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/too-many.hs
@@ -0,0 +1,18 @@
+module TooMany where
+
+foo :: (Int -> Int -> Bool) -> Int
+foo = error "urk"
+
+f1 :: Int -> Int -> Int -> Bool
+f1 = f1
+
+g1 = foo (f1 2 3)
+ -- Here is is sensible to report
+ -- f1 is applied to too many arguments
+
+f2 :: Int -> Bool
+f2 = f2
+
+g2 = foo (f2 2)
+ -- Here is is /not/ sensible to report
+ -- f2 is applied to too many arguments
diff --git a/testsuite/tests/typecheck/should_fail/too-many.stderr b/testsuite/tests/typecheck/should_fail/too-many.stderr
new file mode 100644
index 0000000000..01e50050ff
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/too-many.stderr
@@ -0,0 +1,16 @@
+
+too-many.hs:9:11: error:
+ • Couldn't match type ‘Bool’ with ‘Int -> Bool’
+ Expected: Int -> Int -> Bool
+ Actual: Int -> Bool
+ • Possible cause: ‘f1’ is applied to too many arguments
+ In the first argument of ‘foo’, namely ‘(f1 2 3)’
+ In the expression: foo (f1 2 3)
+ In an equation for ‘g1’: g1 = foo (f1 2 3)
+
+too-many.hs:16:11: error:
+ • Couldn't match expected type ‘Int -> Int -> Bool’
+ with actual type ‘Bool’
+ • In the first argument of ‘foo’, namely ‘(f2 2)’
+ In the expression: foo (f2 2)
+ In an equation for ‘g2’: g2 = foo (f2 2)
diff --git a/testsuite/tests/typecheck/should_run/T9497a-run.stderr b/testsuite/tests/typecheck/should_run/T9497a-run.stderr
index 6461d98b10..7f05844778 100644
--- a/testsuite/tests/typecheck/should_run/T9497a-run.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497a-run.stderr
@@ -1,8 +1,7 @@
T9497a-run: T9497a-run.hs:2:8: error:
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
- • In the expression: _main
- In an equation for ‘main’: main = _main
+ • In an equation for ‘main’: main = _main
• Relevant bindings include
main :: IO () (bound at T9497a-run.hs:2:1)
Valid hole fits include
diff --git a/testsuite/tests/typecheck/should_run/T9497b-run.stderr b/testsuite/tests/typecheck/should_run/T9497b-run.stderr
index a73b71981c..e6155ddae5 100644
--- a/testsuite/tests/typecheck/should_run/T9497b-run.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497b-run.stderr
@@ -1,8 +1,7 @@
T9497b-run: T9497b-run.hs:2:8: error:
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
- • In the expression: _main
- In an equation for ‘main’: main = _main
+ • In an equation for ‘main’: main = _main
• Relevant bindings include
main :: IO () (bound at T9497b-run.hs:2:1)
Valid hole fits include
diff --git a/testsuite/tests/typecheck/should_run/T9497c-run.stderr b/testsuite/tests/typecheck/should_run/T9497c-run.stderr
index 8666900b4e..6ce2781031 100644
--- a/testsuite/tests/typecheck/should_run/T9497c-run.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497c-run.stderr
@@ -1,8 +1,7 @@
T9497c-run: T9497c-run.hs:2:8: error:
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
- • In the expression: _main
- In an equation for ‘main’: main = _main
+ • In an equation for ‘main’: main = _main
• Relevant bindings include
main :: IO () (bound at T9497c-run.hs:2:1)
Valid hole fits include
diff --git a/testsuite/tests/typecheck/should_run/tcrun042.hs b/testsuite/tests/typecheck/should_run/tcrun042.hs
index 30c67601ed..82add262b1 100644
--- a/testsuite/tests/typecheck/should_run/tcrun042.hs
+++ b/testsuite/tests/typecheck/should_run/tcrun042.hs
@@ -22,4 +22,5 @@ e = (,"Hello" ++ "World",)
dropFunction :: (a, String, forall c. c -> c -> c) -> (a, String, Int)
dropFunction (x, y, z) = (x, y, z 10 20)
-main = print (dropFunction $ e "Meh" (flip const), dropFunction $ e 10 const)
+main = print ( dropFunction (e "Meh" (flip const))
+ , dropFunction (e 10 const))
diff --git a/testsuite/tests/warnings/should_compile/PluralS.stderr b/testsuite/tests/warnings/should_compile/PluralS.stderr
index 42c81daf5f..53ed5c4633 100644
--- a/testsuite/tests/warnings/should_compile/PluralS.stderr
+++ b/testsuite/tests/warnings/should_compile/PluralS.stderr
@@ -8,7 +8,7 @@ PluralS.hs:15:17: warning: [-Wtype-defaults (in -Wall)]
PluralS.hs:17:24: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraints to type ‘Integer’
- (Show a0) arising from a use of ‘show’ at PluralS.hs:17:24-31
+ (Show a0) arising from a use of ‘show’ at PluralS.hs:17:24-27
(Num a0) arising from the literal ‘123’ at PluralS.hs:17:29-31
• In the expression: show 123
In an equation for ‘defaultingNumAndShow’: