From a127508137ba69d2fe1e563d2bbb9fdd9120ae85 Mon Sep 17 00:00:00 2001
From: Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io>
Date: Fri, 15 May 2020 15:27:34 +0200
Subject: [PATCH] Add a regression test for #11506

The testcase works now.
See explanation in https://gitlab.haskell.org/ghc/ghc/issues/11506#note_273202
---
 testsuite/tests/typecheck/should_compile/T11506.hs | 13 +++++++++++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 testsuite/tests/typecheck/should_compile/T11506.hs

diff --git a/testsuite/tests/typecheck/should_compile/T11506.hs b/testsuite/tests/typecheck/should_compile/T11506.hs
new file mode 100644
index 00000000000..a5db195e381
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11506.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE PolyKinds, ExistentialQuantification, ScopedTypeVariables,
+             TypeFamilies, TypeInType #-}
+
+module T11506 where
+
+import Data.Proxy
+import Data.Kind
+
+type family ProxyType where ProxyType = (Proxy :: Type -> Type)
+
+data T = forall a. MkT (ProxyType a)
+
+foo (MkT (_ :: Proxy a)) = const True (undefined :: a)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index c4028d6e253..9e19ba6d9b9 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -497,6 +497,7 @@ test('RebindNegate', normal, compile, [''])
 test('T11319', normal, compile, [''])
 test('T11397', normal, compile, [''])
 test('T11458', normal, compile, [''])
+test('T11506', normal, compile, [''])
 test('T11524', normal, compile, [''])
 test('T11552', normal, compile, [''])
 test('T11246', normal, compile, [''])
-- 
GitLab