Commit 30d26058 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #4921

parent 26a3d0fe
{-# LANGUAGE MultiParamTypeClasses #-}
module T4921 where
class C a b where
f :: (a,b)
instance C Int Char where
f = undefined
x = fst f
y = fst f :: Int
T4921.hs:10:9:
No instance for (C a0 b1) arising from a use of ‘f’
The type variables ‘a0’, ‘b1’ are ambiguous
Relevant bindings include x :: a0 (bound at T4921.hs:10:1)
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f
In an equation for ‘x’: x = fst f
T4921.hs:12:9:
No instance for (C Int b0) arising from a use of ‘f’
The type variable ‘b0’ is ambiguous
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f :: Int
In an equation for ‘y’: y = fst f :: Int
......@@ -345,3 +345,4 @@ test('T9201', normal, compile_fail, [''])
test('T9109', normal, compile_fail, [''])
test('T9497d', normal, compile_fail, ['-fdefer-type-errors -fno-defer-typed-holes'])
test('T8044', normal, compile_fail, [''])
test('T4921', 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