Commit 2b67b8f9 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #7862

parent 13817f06
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
module T7862 where
type family Scalar t
newtype Tower s a = Tower [a]
type instance Scalar (Tower s a) = a
class (Num (Scalar t), Num t) => Mode t where
(<+>) :: t -> t -> t
instance (Num a) => Mode (Tower s a) where
Tower as <+> _ = undefined
where
_ = (Tower as) <+> (Tower as)
instance Num a => Num (Tower s a) where
T7862.hs:17:24:
Overlapping instances for Num (Tower s0 a)
arising from a use of ‘<+>’
Matching givens (or their superclasses):
(Num (Tower s a))
bound by the instance declaration at T7862.hs:14:10-36
Matching instances:
instance Num a => Num (Tower s a) -- Defined at T7862.hs:19:10
(The choice depends on the instantiation of ‘a, s0’)
In the expression: (Tower as) <+> (Tower as)
In a pattern binding: _ = (Tower as) <+> (Tower as)
In an equation for ‘<+>’:
(Tower as) <+> _
= undefined
where
_ = (Tower as) <+> (Tower as)
......@@ -130,4 +130,4 @@ test('T9433', normal, compile_fail, [''])
test('BadSock', normal, compile_fail, [''])
test('T9580', normal, multimod_compile_fail, ['T9580', ''])
test('T9662', normal, compile_fail, [''])
test('T7862', 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