Commit 80d665a1 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Two tests for Trac #14230

parent b1af0aed
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module T14230 where
class C k where
data CD :: k -> k -> *
instance C (Maybe a) where
data CD :: (k -> *) -> (k -> *) -> *
T14230.hs:11:3: error:
• Type indexes must match class instance head
Expected: CD @(Maybe a)
Actual: CD @(k -> *) -- Defined at T14230.hs:11:8
• In the data instance declaration for ‘CD’
In the instance declaration for ‘C (Maybe a)’
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
module T14230a where
import Data.Kind
class C a where
data CD k (a :: k) :: k -> *
instance C (Maybe a) where
data CD k (a :: k -> *) :: (k -> *) -> *
T14230a.hs:13:14: error:
• Expected kind ‘k -> *’, but ‘a’ has kind ‘*’
• In the second argument of ‘CD’, namely ‘(a :: k -> *)’
In the data instance declaration for ‘CD’
In the instance declaration for ‘C (Maybe a)’
......@@ -152,3 +152,5 @@ test('T15740', normal, compile_fail, [''])
test('T15764', normal, compile_fail, [''])
test('T15870', normal, compile_fail, [''])
test('T14887', normal, compile_fail, [''])
test('T14230', normal, compile_fail, [''])
test('T14230a', normal, compile_fail, [''])
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