Commit 0b7702db authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #4875

parent 0cfcb53b
{-# OPTIONS -XMultiParamTypeClasses -XFunctionalDependencies -XFlexibleInstances #-}
module HaskellBug where
data Relation c -- The basic Relation
= Rel { relnm :: String -- The name of the relation
, relsrc :: c -- Source concept
, reltrg :: c -- ^Target concept
}
deriving Eq
-- This declaration is ok; should not get an error here
class (Eq concept)=> Association rel concept | rel -> concept where
source, target :: rel -> concept
-- e.g. Declaration Concept -> Concept
sign :: rel -> (concept,concept)
sign x = (source x,target x)
homogeneous :: rel -> Bool
homogeneous s = source s == target s
instance (Eq c)=>Association (Relation c) c where
source = relsrc
target = reltrg
-- This declaration has a kind error
-- The error should be reported here
class (Eq c, Association r c) => Morphic r c where
multiplicities :: r c -> [c]
multiplicities _ = []
T4875.hs:27:24:
`r' is applied to too many type arguments
In the type `r c -> [c]'
In the class declaration for `Morphic'
......@@ -226,3 +226,4 @@ test('T3468', extra_clean(['T3468.hi-boot']),
test('T2846b', normal, compile_fail, [''])
test('FrozenErrorTests', normal, compile_fail, [''])
test('SCLoop', normal, compile_fail, [''])
test('T4875', 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