diff options
-rw-r--r-- | testsuite/tests/polykinds/T10503.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T10503.stderr | 16 | ||||
-rw-r--r-- | testsuite/tests/polykinds/all.T | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T10503.hs b/testsuite/tests/polykinds/T10503.hs new file mode 100644 index 0000000000..2cc1ee717e --- /dev/null +++ b/testsuite/tests/polykinds/T10503.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE RankNTypes, PolyKinds, DataKinds, TypeFamilies #-} +module GHCBug where + +data Proxy p = Proxy + +data KProxy (a :: *) = KProxy + +h :: forall r . (Proxy ('KProxy :: KProxy k) ~ Proxy ('KProxy :: KProxy *) => r) -> r +h = undefined diff --git a/testsuite/tests/polykinds/T10503.stderr b/testsuite/tests/polykinds/T10503.stderr new file mode 100644 index 0000000000..e2817fe776 --- /dev/null +++ b/testsuite/tests/polykinds/T10503.stderr @@ -0,0 +1,16 @@ + +T10503.hs:8:6: error: + Couldn't match kind ‘k’ with ‘*’ + ‘k’ is a rigid type variable bound by + the type signature for: + h :: ((Proxy 'KProxy ~ Proxy 'KProxy) => r) -> r + at T10503.hs:8:6 + Expected type: Proxy 'KProxy + Actual type: Proxy 'KProxy + In the ambiguity check for the type signature for ‘h’: + h :: forall (k :: BOX) r. + ((Proxy 'KProxy ~ Proxy 'KProxy) => r) -> r + To defer the ambiguity check to use sites, enable AllowAmbiguousTypes + In the type signature for ‘h’: + h :: forall r. + (Proxy (KProxy :: KProxy k) ~ Proxy (KProxy :: KProxy *) => r) -> r diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 76af3ecf00..95f0d8321a 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -117,3 +117,4 @@ test('T7908', normal, compile, ['']) test('T10041', normal, compile, ['']) test('T10451', normal, compile_fail, ['']) test('T10516', normal, compile_fail, ['']) +test('T10503', normal, compile_fail, ['']) |