summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-12-20 14:05:27 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-12-20 14:07:16 +0000
commit5f2a8793514918eaa670347ce0d95dfdbbdd4f4d (patch)
tree0e0d20ea28632554b2576fe1a23524649223d9bd /testsuite/tests
parenta1c3ad0450baedadc223969dd2b09f59872a38e7 (diff)
downloadhaskell-5f2a8793514918eaa670347ce0d95dfdbbdd4f4d.tar.gz
Refine the suppression of RuntimeRep variables
When we pretty-print types, we suppress RuntimeRep variables, but we were being too aggressive in doing so, resulting in Trac #16074. This patch makes the suppression a bit less aggressive. See Note [Defaulting RuntimeRep variables]
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_fail/T16074.hs10
-rw-r--r--testsuite/tests/typecheck/should_fail/T16074.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T16074.hs b/testsuite/tests/typecheck/should_fail/T16074.hs
new file mode 100644
index 0000000000..c6e067dc22
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16074.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE GADTs, TypeOperators, PolyKinds #-}
+
+module T16074 where
+
+import GHC.Types
+
+data a :~: b where Refl :: a :~: a
+
+foo :: TYPE a :~: TYPE b
+foo = Refl
diff --git a/testsuite/tests/typecheck/should_fail/T16074.stderr b/testsuite/tests/typecheck/should_fail/T16074.stderr
new file mode 100644
index 0000000000..cd04542641
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16074.stderr
@@ -0,0 +1,17 @@
+
+T16074.hs:10:7: error:
+ • Couldn't match type ‘a’ with ‘b’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ foo :: * :~: *
+ at T16074.hs:9:1-24
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ foo :: * :~: *
+ at T16074.hs:9:1-24
+ Expected type: TYPE a :~: TYPE b
+ Actual type: TYPE a :~: TYPE a
+ • In the expression: Refl
+ In an equation for ‘foo’: foo = Refl
+ • Relevant bindings include
+ foo :: TYPE a :~: TYPE b (bound at T16074.hs:10:1)
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index e8efeb5468..f0afa0d3a9 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -492,3 +492,4 @@ test('T15648', [extra_files(['T15648a.hs'])], multimod_compile_fail, ['T15648',
test('T15796', normal, compile_fail, [''])
test('T15954', normal, compile_fail, [''])
test('T15962', normal, compile_fail, [''])
+test('T16074', normal, compile_fail, [''])