Commit 539a9bf8 authored by ian@well-typed.com's avatar ian@well-typed.com

Add a test for #7848

parent 02293783
module T7848 where
data A = (:&&) Int Int | A Int Int
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h) = y
where infixl 3 `y`
y _ = (&)
{-# INLINE (&) #-}
{-# SPECIALIZE (&) :: a #-}
(&) = x
T7848.hs:10:9:
Couldn't match expected type ‛forall a. a’
with actual type ‛t -> t1 -> A -> A -> A -> A -> t2’
Relevant bindings include
x :: t -> t1 -> A -> A -> A -> A -> t2 (bound at T7848.hs:6:1)
(+) :: t (bound at T7848.hs:6:3)
(&) :: t1 (bound at T7848.hs:6:8)
z :: t1 (bound at T7848.hs:6:12)
In the SPECIALISE pragma {-# SPECIALIZE (&) :: a #-}
In an equation for ‛x’:
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h)
= y
where
infixl 3 `y`
y _ = (&)
{-# INLINE (&) #-}
{-# SPECIALIZE (&) :: a #-}
(&) = x
......@@ -77,3 +77,4 @@ test('ParserNoMultiWayIf', when(compiler_lt('ghc', '7.5'), skip), compile_fail,
test('T5425', normal, compile_fail, [''])
test('T984', normal, compile_fail, [''])
test('T7848', normal, compile_fail, ['-dppr-user-length=100'])
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