summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-05-03 22:04:19 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-08 15:47:33 -0400
commit4c86187ccd49309c1d6b32d05b164822a803d3e2 (patch)
treeb7ade7c3ca4d9443f3064b12e92ac143511f032c
parent9a3acac968d76370e12839db4b71bb0a43e35b2c (diff)
downloadhaskell-4c86187ccd49309c1d6b32d05b164822a803d3e2.tar.gz
Regression test for #16627.
test: typecheck/should_fail/T16627
-rw-r--r--testsuite/tests/typecheck/should_fail/T16627.hs14
-rw-r--r--testsuite/tests/typecheck/should_fail/T16627.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T16627.hs b/testsuite/tests/typecheck/should_fail/T16627.hs
new file mode 100644
index 0000000000..0aec91a0fe
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16627.hs
@@ -0,0 +1,14 @@
+{-# language TypeInType, ScopedTypeVariables #-}
+module Silly where
+import Type.Reflection (Typeable, typeRep, TypeRep)
+import Type.Reflection.Unsafe (mkTrApp)
+import GHC.Exts (TYPE, RuntimeRep (..))
+import Data.Kind (Type)
+
+mkTrFun :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
+ (a :: TYPE r1) (b :: TYPE r2).
+ TypeRep a -> TypeRep b -> TypeRep ((a -> b) :: Type)
+mkTrFun a b = typeRep `mkTrApp` a `mkTrApp` b
+
+-- originally reported that there was no (Typeable LiftedRep) instance,
+-- presumably to overeager RuntimeRep defaulting
diff --git a/testsuite/tests/typecheck/should_fail/T16627.stderr b/testsuite/tests/typecheck/should_fail/T16627.stderr
new file mode 100644
index 0000000000..108e99f44a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16627.stderr
@@ -0,0 +1,6 @@
+
+T16627.hs:11:15: error:
+ • No instance for (Typeable r1) arising from a use of ‘typeRep’
+ • In the first argument of ‘mkTrApp’, namely ‘typeRep’
+ In the first argument of ‘mkTrApp’, namely ‘typeRep `mkTrApp` a’
+ In the expression: typeRep `mkTrApp` a `mkTrApp` b
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index fec3a3ae67..c51398f00b 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -514,3 +514,4 @@ test('T16255', normal, compile_fail, [''])
test('T16204c', normal, compile_fail, [''])
test('T16394', normal, compile_fail, [''])
test('T16414', normal, compile_fail, [''])
+test('T16627', normal, compile_fail, [''])