Commit a09508b7 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu
Browse files

Test #9371 (indexed-types/should_fail/T9371)

parent 64151913
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module T9371 where
import Data.Monoid
class C x where
data D x :: *
makeD :: D x
instance {-# OVERLAPPABLE #-} Monoid x => C x where
data D x = D1 (Either x ())
makeD = D1 (Left mempty)
instance (Monoid x, Monoid y) => C (x, y) where
data D (x,y) = D2 (x,y)
makeD = D2 (mempty, mempty)
instance Show x => Show (D x) where
show (D1 x) = show x
main = print (makeD :: D (String, String))
T9371.hs:14:10:
Conflicting family instance declarations:
D -- Defined at T9371.hs:14:10
D (x, y) -- Defined at T9371.hs:18:10
......@@ -125,3 +125,4 @@ test('T9171', normal, compile_fail, [''])
test('T9097', normal, compile_fail, [''])
test('T9160', normal, compile_fail, [''])
test('T9357', normal, compile_fail, [''])
test('T9371', 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