Commit 3c08377f authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #5858

parent 9d9a8975
{-# LANGUAGE FlexibleInstances, GADTs #-}
module T5858 where
class InferOverloaded a where
infer :: a -> String
-- instance (t1 ~ String, t2 ~ String) => InferOverloaded (t1,t2) where
instance (t1 ~ String) => InferOverloaded (t1,t1) where
infer = show . fst
foo = infer ([],[])
No instance for (InferOverloaded ([a0], [a1]))
arising from a use of `infer'
The type variables `a0', `a1' are ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there is a potential instance available:
instance t1 ~ String => InferOverloaded (t1, t1)
-- Defined at T5858.hs:8:10
Possible fix:
add an instance declaration for (InferOverloaded ([a0], [a1]))
In the expression: infer ([], [])
In an equation for `foo': foo = infer ([], [])
......@@ -269,4 +269,5 @@ test('T5570', normal, compile_fail, [''])
test('T5573a', normal, compile_fail, [''])
test('T5573b', normal, compile_fail, [''])
test('T5689', normal, compile_fail, [''])
test('T5684', normal, compile_fail, [''])
\ No newline at end of file
test('T5684', normal, compile_fail, [''])
test('T5858', 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