Regression test for #16627.
authorRichard Eisenberg <rae@richarde.dev>
Sat, 4 May 2019 02:04:19 +0000 (22:04 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 8 May 2019 19:47:33 +0000 (15:47 -0400)
test: typecheck/should_fail/T16627

testsuite/tests/typecheck/should_fail/T16627.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T16627.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T16627.hs b/testsuite/tests/typecheck/should_fail/T16627.hs
new file mode 100644 (file)
index 0000000..0aec91a
--- /dev/null
@@ -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 (file)
index 0000000..108e99f
--- /dev/null
@@ -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
index fec3a3a..c51398f 100644 (file)
@@ -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, [''])