Commit 8d7496c4 authored by Chaitanya Koparkar's avatar Chaitanya Koparkar Committed by Ryan Scott

Add a test case for #15962

Test Plan: make test TEST=T15962

Reviewers: RyanGlScott, bgamari

Reviewed By: RyanGlScott

Subscribers: rwbarton, carter

GHC Trac Issues: #15962

Differential Revision: https://phabricator.haskell.org/D5393
parent 30a363ae
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
module T15962 where
import Data.Kind (Type)
type Exp a = a -> Type
type family Eval (e :: Exp a) :: a
data OpKind = Conjunction
data Dual (k :: OpKind) :: Exp OpKind
data Map :: (a -> Exp b) -> [ a ] -> Exp [ b ]
type instance Eval (Map f (a ': as)) = Eval (f a) ': Eval (Map f as)
data Big :: [ OpKind ] -> Type where
Big :: [ Big ks ] -> Big ('Conjunction ': ks)
dualBig :: Big ks -> Big (Eval (Map Dual ks))
dualBig = _
instance Semigroup (Big a) where
Big xs <> Big ys = Big (xs <> ys)
instance Monoid (Big ('Conjunction ': ks)) where
mempty = iDontExist
flatten :: Monoid (Big ks) => Big (k ': k ': ks) -> Big ks
flatten = undefined
T15962.hs:27:11:
Found hole: _ :: Big ks -> Big (Eval (Map Dual ks))
Where: ‘ks’ is a rigid type variable bound by
the type signature for:
dualBig :: forall (ks :: [OpKind]).
Big ks -> Big (Eval (Map Dual ks))
at T15962.hs:26:1-45
In the expression: _
In an equation for ‘dualBig’: dualBig = _
Relevant bindings include
dualBig :: Big ks -> Big (Eval (Map Dual ks))
(bound at T15962.hs:27:1)
Valid hole fits include
dualBig :: Big ks -> Big (Eval (Map Dual ks))
(bound at T15962.hs:27:1)
T15962.hs:33:12:
Variable not in scope: iDontExist :: Big ('Conjunction : ks)
......@@ -489,3 +489,4 @@ test('T15629', normal, compile_fail, [''])
test('T15767', normal, compile_fail, [''])
test('T15648', [extra_files(['T15648a.hs'])], multimod_compile_fail, ['T15648', '-v0 -fprint-equality-relations'])
test('T15796', normal, compile_fail, [''])
test('T15962', 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