summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/dependent/should_fail/T11471.hs15
-rw-r--r--testsuite/tests/dependent/should_fail/T11471.stderr18
-rw-r--r--testsuite/tests/dependent/should_fail/all.T1
-rw-r--r--testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T1897b.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T1900.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T2544.stderr8
-rw-r--r--testsuite/tests/indexed-types/should_fail/T2693.stderr2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4179.stderr2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T7729.stderr2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T7729a.stderr2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T9036.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T9171.stderr1
-rw-r--r--testsuite/tests/polykinds/T9144.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T8030.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T8034.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T8142.stderr4
17 files changed, 58 insertions, 22 deletions
diff --git a/testsuite/tests/dependent/should_fail/T11471.hs b/testsuite/tests/dependent/should_fail/T11471.hs
new file mode 100644
index 0000000000..19025db22b
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T11471.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MagicHash, PolyKinds, TypeFamilies #-}
+
+module T11471 where
+
+import GHC.Exts
+import Data.Proxy
+
+type family F a :: k
+
+type instance F Int = Int#
+
+f :: Proxy a -> F a -> F a
+f _ x = x
+
+bad = f (undefined :: Proxy Int#) 3#
diff --git a/testsuite/tests/dependent/should_fail/T11471.stderr b/testsuite/tests/dependent/should_fail/T11471.stderr
new file mode 100644
index 0000000000..0578910d48
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T11471.stderr
@@ -0,0 +1,18 @@
+
+T11471.hs:15:10: error:
+ • Couldn't match a lifted type with an unlifted type
+ Expected type: Proxy Int#
+ Actual type: Proxy Int#
+ Use -fprint-explicit-kinds to see the kind arguments
+ • In the first argument of ‘f’, namely ‘(undefined :: Proxy Int#)’
+ In the expression: f (undefined :: Proxy Int#) 3#
+ In an equation for ‘bad’: bad = f (undefined :: Proxy Int#) 3#
+
+T11471.hs:15:35: error:
+ • Couldn't match a lifted type with an unlifted type
+ When matching types
+ F Int# :: *
+ Int# :: TYPE 'IntRep
+ • In the second argument of ‘f’, namely ‘3#’
+ In the expression: f (undefined :: Proxy Int#) 3#
+ In an equation for ‘bad’: bad = f (undefined :: Proxy Int#) 3#
diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T
index c75a9c6a56..9565bc0150 100644
--- a/testsuite/tests/dependent/should_fail/all.T
+++ b/testsuite/tests/dependent/should_fail/all.T
@@ -13,3 +13,4 @@ test('T11334', normal, compile_fail, [''])
test('InferDependency', normal, compile_fail, [''])
test('KindLevelsB', normal, compile_fail, [''])
test('T11473', normal, compile_fail, [''])
+test('T11471', normal, compile_fail, [''])
diff --git a/testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr b/testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
index 8afd3759fa..7a553f301c 100644
--- a/testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
+++ b/testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
@@ -1,10 +1,10 @@
NoMatchErr.hs:19:7: error:
• Couldn't match type ‘Memo d0’ with ‘Memo d’
- NB: ‘Memo’ is a type function, and may not be injective
- The type variable ‘d0’ is ambiguous
Expected type: Memo d a -> Memo d a
Actual type: Memo d0 a -> Memo d0 a
+ NB: ‘Memo’ is a type function, and may not be injective
+ The type variable ‘d0’ is ambiguous
• In the ambiguity check for ‘f’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature:
diff --git a/testsuite/tests/indexed-types/should_fail/T1897b.stderr b/testsuite/tests/indexed-types/should_fail/T1897b.stderr
index e70a256f98..b83c7ffe78 100644
--- a/testsuite/tests/indexed-types/should_fail/T1897b.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T1897b.stderr
@@ -1,10 +1,10 @@
T1897b.hs:16:1: error:
• Couldn't match type ‘Depend a’ with ‘Depend a0’
- NB: ‘Depend’ is a type function, and may not be injective
- The type variable ‘a0’ is ambiguous
Expected type: t (Depend a) -> Bool
Actual type: t (Depend a0) -> Bool
+ NB: ‘Depend’ is a type function, and may not be injective
+ The type variable ‘a0’ is ambiguous
• In the ambiguity check for the inferred type for ‘isValid’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type
diff --git a/testsuite/tests/indexed-types/should_fail/T1900.stderr b/testsuite/tests/indexed-types/should_fail/T1900.stderr
index dbcbddc0af..0783a2dba7 100644
--- a/testsuite/tests/indexed-types/should_fail/T1900.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T1900.stderr
@@ -1,10 +1,10 @@
T1900.hs:7:3: error:
• Couldn't match type ‘Depend s0’ with ‘Depend s’
- NB: ‘Depend’ is a type function, and may not be injective
- The type variable ‘s0’ is ambiguous
Expected type: Depend s -> Depend s
Actual type: Depend s0 -> Depend s0
+ NB: ‘Depend’ is a type function, and may not be injective
+ The type variable ‘s0’ is ambiguous
• In the ambiguity check for ‘trans’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method:
diff --git a/testsuite/tests/indexed-types/should_fail/T2544.stderr b/testsuite/tests/indexed-types/should_fail/T2544.stderr
index a296a36910..6375c8f79e 100644
--- a/testsuite/tests/indexed-types/should_fail/T2544.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T2544.stderr
@@ -1,10 +1,10 @@
T2544.hs:17:18: error:
• Couldn't match type ‘IxMap i0’ with ‘IxMap l’
- NB: ‘IxMap’ is a type function, and may not be injective
- The type variable ‘i0’ is ambiguous
Expected type: IxMap l [Int]
Actual type: IxMap i0 [Int]
+ NB: ‘IxMap’ is a type function, and may not be injective
+ The type variable ‘i0’ is ambiguous
• In the first argument of ‘BiApp’, namely ‘empty’
In the expression: BiApp empty empty
In an equation for ‘empty’: empty = BiApp empty empty
@@ -13,10 +13,10 @@ T2544.hs:17:18: error:
T2544.hs:17:24: error:
• Couldn't match type ‘IxMap i1’ with ‘IxMap r’
- NB: ‘IxMap’ is a type function, and may not be injective
- The type variable ‘i1’ is ambiguous
Expected type: IxMap r [Int]
Actual type: IxMap i1 [Int]
+ NB: ‘IxMap’ is a type function, and may not be injective
+ The type variable ‘i1’ is ambiguous
• In the second argument of ‘BiApp’, namely ‘empty’
In the expression: BiApp empty empty
In an equation for ‘empty’: empty = BiApp empty empty
diff --git a/testsuite/tests/indexed-types/should_fail/T2693.stderr b/testsuite/tests/indexed-types/should_fail/T2693.stderr
index b41e19f3e1..5e925c3148 100644
--- a/testsuite/tests/indexed-types/should_fail/T2693.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T2693.stderr
@@ -33,9 +33,9 @@ T2693.hs:19:23: error:
T2693.hs:30:47: error:
• Couldn't match type ‘TFn a0’ with ‘PVR a1’
- The type variables ‘a0’, ‘a1’ are ambiguous
Expected type: [PVR a1]
Actual type: [TFn a0]
+ The type variables ‘a0’, ‘a1’ are ambiguous
• In the second argument of ‘map’, namely ‘pvs’
In the second argument of ‘min’, namely ‘(map pvrX pvs)’
In the expression: (map pvrX pvs) `min` (map pvrX pvs)
diff --git a/testsuite/tests/indexed-types/should_fail/T4179.stderr b/testsuite/tests/indexed-types/should_fail/T4179.stderr
index 0dfa2dbf3e..f3411a05cd 100644
--- a/testsuite/tests/indexed-types/should_fail/T4179.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4179.stderr
@@ -2,7 +2,6 @@
T4179.hs:26:16: error:
• Couldn't match type ‘A2 (x (A2 (FCon x) -> A3 (FCon x)))’
with ‘A2 (FCon x)’
- NB: ‘A2’ is a type function, and may not be injective
Expected type: x (A2 (x (A2 (FCon x) -> A3 (FCon x)))
-> A3 (x (A2 (FCon x) -> A3 (FCon x))))
-> A2 (x (A2 (FCon x) -> A3 (FCon x)))
@@ -10,6 +9,7 @@ T4179.hs:26:16: error:
Actual type: x (A2 (FCon x) -> A3 (FCon x))
-> A2 (x (A2 (FCon x) -> A3 (FCon x)))
-> A3 (x (A2 (FCon x) -> A3 (FCon x)))
+ NB: ‘A2’ is a type function, and may not be injective
• In the first argument of ‘foldDoC’, namely ‘op’
In the expression: foldDoC op
In an equation for ‘fCon’: fCon = foldDoC op
diff --git a/testsuite/tests/indexed-types/should_fail/T7729.stderr b/testsuite/tests/indexed-types/should_fail/T7729.stderr
index aa71a9774a..80b6fd82d9 100644
--- a/testsuite/tests/indexed-types/should_fail/T7729.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7729.stderr
@@ -1,9 +1,9 @@
T7729.hs:36:25: error:
• Couldn't match type ‘BasePrimMonad m’ with ‘t0 (BasePrimMonad m)’
- The type variable ‘t0’ is ambiguous
Expected type: BasePrimMonad m a -> BasePrimMonad (Rand m) a
Actual type: BasePrimMonad m a -> t0 (BasePrimMonad m) a
+ The type variable ‘t0’ is ambiguous
• In the second argument of ‘(.)’, namely ‘lift’
In the expression: liftPrim . lift
In an equation for ‘liftPrim’: liftPrim = liftPrim . lift
diff --git a/testsuite/tests/indexed-types/should_fail/T7729a.stderr b/testsuite/tests/indexed-types/should_fail/T7729a.stderr
index 513a132191..e5a6289d96 100644
--- a/testsuite/tests/indexed-types/should_fail/T7729a.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7729a.stderr
@@ -1,9 +1,9 @@
T7729a.hs:36:26: error:
• Couldn't match type ‘BasePrimMonad m’ with ‘t0 (BasePrimMonad m)’
- The type variable ‘t0’ is ambiguous
Expected type: BasePrimMonad (Rand m) a
Actual type: t0 (BasePrimMonad m) a
+ The type variable ‘t0’ is ambiguous
• In the first argument of ‘liftPrim’, namely ‘(lift x)’
In the expression: liftPrim (lift x)
In an equation for ‘liftPrim’: liftPrim x = liftPrim (lift x)
diff --git a/testsuite/tests/indexed-types/should_fail/T9036.stderr b/testsuite/tests/indexed-types/should_fail/T9036.stderr
index 3d768de1eb..cb12dea5b5 100644
--- a/testsuite/tests/indexed-types/should_fail/T9036.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T9036.stderr
@@ -1,10 +1,10 @@
T9036.hs:17:17: error:
• Couldn't match type ‘Curried t0 [t0]’ with ‘Curried t [t]’
- NB: ‘Curried’ is a type function, and may not be injective
- The type variable ‘t0’ is ambiguous
Expected type: Maybe (GetMonad t after) -> Curried t [t]
Actual type: Maybe (GetMonad t0 after) -> Curried t0 [t0]
+ NB: ‘Curried’ is a type function, and may not be injective
+ The type variable ‘t0’ is ambiguous
• In the ambiguity check for ‘simpleLogger’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature:
diff --git a/testsuite/tests/indexed-types/should_fail/T9171.stderr b/testsuite/tests/indexed-types/should_fail/T9171.stderr
index 5ffb87b0ea..db44dd7185 100644
--- a/testsuite/tests/indexed-types/should_fail/T9171.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T9171.stderr
@@ -4,6 +4,7 @@ T9171.hs:10:20: error:
with actual type ‘GetParam Base (GetParam Base Int)’
NB: ‘GetParam’ is a type function, and may not be injective
The type variable ‘k20’ is ambiguous
+ Use -fprint-explicit-kinds to see the kind arguments
• In the ambiguity check for an expression type signature
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In an expression type signature: GetParam Base (GetParam Base Int)
diff --git a/testsuite/tests/polykinds/T9144.stderr b/testsuite/tests/polykinds/T9144.stderr
index b62d1f175d..5db0260fc9 100644
--- a/testsuite/tests/polykinds/T9144.stderr
+++ b/testsuite/tests/polykinds/T9144.stderr
@@ -3,6 +3,7 @@ T9144.hs:34:26: error:
• Couldn't match type ‘Integer’ with ‘FooTerm’
Expected type: DemoteRep 'KProxy
Actual type: DemoteRep 'KProxy
+ Use -fprint-explicit-kinds to see the kind arguments
• In the first argument of ‘toSing’, namely ‘n’
In the expression: toSing n
In the expression:
diff --git a/testsuite/tests/typecheck/should_fail/T8030.stderr b/testsuite/tests/typecheck/should_fail/T8030.stderr
index 6e902a4294..d9c34cd533 100644
--- a/testsuite/tests/typecheck/should_fail/T8030.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8030.stderr
@@ -11,10 +11,10 @@ T8030.hs:9:3: error:
T8030.hs:10:3: error:
• Couldn't match type ‘Pr a0’ with ‘Pr a’
+ Expected type: Pr a -> Pr a -> Pr a
+ Actual type: Pr a0 -> Pr a0 -> Pr a0
NB: ‘Pr’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
- Expected type: Pr a -> Pr a -> Pr a
- Actual type: Pr a0 -> Pr a0 -> Pr a0
• In the ambiguity check for ‘op2’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method:
diff --git a/testsuite/tests/typecheck/should_fail/T8034.stderr b/testsuite/tests/typecheck/should_fail/T8034.stderr
index 1a2b1f7791..247732a0bd 100644
--- a/testsuite/tests/typecheck/should_fail/T8034.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8034.stderr
@@ -1,10 +1,10 @@
T8034.hs:6:3: error:
• Couldn't match type ‘F a0’ with ‘F a’
- NB: ‘F’ is a type function, and may not be injective
- The type variable ‘a0’ is ambiguous
Expected type: F a -> F a
Actual type: F a0 -> F a0
+ NB: ‘F’ is a type function, and may not be injective
+ The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘foo’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method: foo :: forall a. C a => F a -> F a
diff --git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index 09a2a9677d..3faa530996 100644
--- a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ -1,10 +1,10 @@
T8142.hs:6:18: error:
• Couldn't match type ‘Nu g0’ with ‘Nu g’
- NB: ‘Nu’ is a type function, and may not be injective
- The type variable ‘g0’ is ambiguous
Expected type: Nu ((,) t) -> Nu g
Actual type: Nu ((,) t0) -> Nu g0
+ NB: ‘Nu’ is a type function, and may not be injective
+ The type variable ‘g0’ is ambiguous
• In the ambiguity check for the inferred type for ‘h’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type