Commit f0c4e460 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Add tests for #11391

parent 91dcc655
{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-}
{-# LANGUAGE UndecidableInstances #-}
-- The "bad case" in #11391
module CustomTypeErrors04 where
import Data.Kind
import GHC.TypeLits (TypeError, ErrorMessage(..))
type family Resolve (t :: Type -> Type) :: Type -> Type where
Resolve _ = TypeError (Text "ERROR")
testNOTOK1 :: Resolve [] Int
testNOTOK1 = ()
CustomTypeErrors04.hs:14:14: error:
• ERROR
• In the expression: ()
In an equation for ‘testNOTOK1’: testNOTOK1 = ()
{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-}
{-# LANGUAGE UndecidableInstances #-}
-- The "tricky case" in #11391
module CustomTypeErrors05 where
import Data.Kind
import GHC.TypeLits (TypeError, ErrorMessage(..))
type family Resolve (t :: Type -> Type) :: Type -> Type where
Resolve _ = TypeError (Text "ERROR")
testNOTOK2 :: Resolve [] Int
testNOTOK2 = 1
CustomTypeErrors05.hs:14:14: error:
• ERROR
• In the expression: 1
In an equation for ‘testNOTOK2’: testNOTOK2 = 1
......@@ -394,6 +394,8 @@ test('T10971d', extra_clean(['T10971c.hi', 'T10971c.o']), multimod_compile_fail,
test('CustomTypeErrors01', normal, compile_fail, [''])
test('CustomTypeErrors02', normal, compile_fail, [''])
test('CustomTypeErrors03', normal, compile_fail, [''])
test('CustomTypeErrors04', normal, compile_fail, [''])
test('CustomTypeErrors05', normal, compile_fail, [''])
test('T11112', normal, compile_fail, [''])
test('ClassOperator', normal, compile_fail, [''])
test('T11274', 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