Commit 5bf960ef authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #1897

parent 70201451
{-# LANGUAGE TypeFamilies #-}
module T1897b where
import Control.Monad
import Data.Maybe
class Bug s where
type Depend s
next :: s -> Depend s -> Maybe s
start :: s
-- isValid :: (Bug s) => [Depend s] -> Bool
-- Inferred type should be rejected as ambiguous
isValid ds = isJust $ foldM next start ds
......@@ -69,4 +69,4 @@ test('DerivUnsatFam', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [
test('T2664', normal, compile_fail, [''])
test('T2664a', normal, compile, [''])
test('T2544', normal, compile_fail, [''])
test('T1897b', normal, compile_fail, [''])
{-# LANGUAGE MultiParamTypeClasses #-}
module Foo where
class Wob a b where
to :: a -> b
from :: b -> a
foo x = [x, to (from x)]
-- Ambiguous type: Wob a b => b -> [b]
-- Should be rejected
......@@ -244,3 +244,4 @@ test('T5236',normal,compile_fail,[''])
test('T5246',normal,compile_fail,[''])
test('T5300',normal,compile_fail,[''])
test('T5095',normal,compile_fail,[''])
test('T1897a',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