Commit aa03ad88 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Simplify the kind checking for type/class decls

This patch deletes quite a bit of code,
AND fixes Trac #15116.
parent 5b3104ab
This diff is collapsed.
{-# LANGUAGE GADTs, PolyKinds, DataKinds #-}
module T15116 where
import Data.Proxy
data A (a :: k) where
MkA :: A MkA
T15116.hs:7:12: error:
• Data constructor ‘MkA’ cannot be used here
(it is defined and used in the same recursive group)
• In the first argument of ‘A’, namely ‘MkA’
In the type ‘A MkA’
In the definition of data constructor ‘MkA’
{-# LANGUAGE PolyKinds, DataKinds #-}
module T15116a where
import Data.Proxy
data B = MkB (Proxy 'MkB)
T15116a.hs:6:21: error:
• Data constructor ‘MkB’ cannot be used here
(it is defined and used in the same recursive group)
• In the first argument of ‘Proxy’, namely ‘ 'MkB’
In the type ‘(Proxy 'MkB)’
In the definition of data constructor ‘MkB’
......@@ -188,3 +188,5 @@ test('T14723', normal, compile, [''])
test('T14846', normal, compile_fail, [''])
test('T14873', normal, compile, [''])
test('SigTvKinds3', normal, compile_fail, [''])
test('T15116', normal, compile_fail, [''])
test('T15116a', normal, compile_fail, [''])
......@@ -6,3 +6,8 @@ T14904a.hs:8:1: error:
Inferred kinds of user-written variables:
g :: k0 -> *
f :: forall (a :: k0). g a
T14904a.hs:9:6: error:
• Expected kind ‘forall (a :: k1). g a’, but ‘f’ has kind ‘k0’
• In the first argument of ‘F’, namely ‘(f :: forall a. g a)’
In the type family declaration for ‘F’
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment