Commit 65128ed7 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #8392

parent 067f78b2
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, UndecidableInstances, AllowAmbiguousTypes #-}
module T8392 where
class Fun f a b where
fun :: f -> a -> b
instance (b ~ Int, a ~ Int) => Fun F a b
where fun _ = (+1)
data F = F
data Compose a b = Compose a b
-- ghc-7.6 version
instance (Fun f b c, Fun g a b) => Fun (Compose f g) a c where
fun (Compose f g) a = fun f (fun g a :: b)
\ No newline at end of file
......@@ -410,3 +410,4 @@ test('T7891', normal, compile, [''])
test('T7903', normal, compile, [''])
test('TcTypeNatSimple', normal, compile, [''])
test('TcCoercibleCompile', when(compiler_lt('ghc', '7.7'), skip), compile, [''])
test('T8392', normal, compile, [''])
{-# LANGUAGE GADTs, AllowAmbiguousTypes #-}
module T8392a where
-- Should complain even with AllowAmbiguousTypes
foo :: (Int ~ Bool) => a -> a
foo x = x
T8392a.hs:6:8:
Couldn't match type ‛Int’ with ‛Bool’
Inaccessible code in
the type signature for foo :: Int ~ Bool => a -> a
In the ambiguity check for: forall a. Int ~ Bool => a -> a
In the type signature for ‛foo’: foo :: Int ~ Bool => a -> a
......@@ -320,3 +320,5 @@ test('TcCoercibleFail', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''
test('TcCoercibleFailSafe', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''])
test('TcCoercibleFail2', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''])
test('T8306', normal, compile_fail, [''])
test('T8392a', 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