Commit df5a4866 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #3169

parent 0491ff94
{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-}
module T3169 where
import Prelude hiding ( lookup )
class Key k where
type Map k :: * -> *
lookup :: k -> Map k elt -> Maybe elt
instance (Key a, Key b) => Key (a,b) where
type Map (a,b) = MP a b
lookup (a,b) (m :: Map (a,b) elt)
= case lookup a m :: Maybe (Map b elt) of
Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt
data MP a b elt = MP (Map a (Map b elt))
Couldn't match type `elt' with `Map b elt'
`elt' is a rigid type variable bound by
the type signature for
lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
at T3169.hs:12:3
Expected type: Maybe (Map b elt)
Actual type: Maybe elt
In the return type of a call of `lookup'
In the expression: lookup a m :: Maybe (Map b elt)
......@@ -104,4 +104,5 @@ test('gadtSyntax001', normal, compile, [''])
test('gadtSyntaxFail001', normal, compile_fail, [''])
test('gadtSyntaxFail002', normal, compile_fail, [''])
test('gadtSyntaxFail003', normal, compile_fail, [''])
test('T3169', normal, compile_fail, [''])
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment