summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-07-31 15:49:14 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2014-07-31 15:49:45 +0100
commit1ae5fa451f4f554e0d652d55f9312a585188ce13 (patch)
tree1d0ef82924eedf6803b48b8d0ba7748f9622b227 /testsuite
parentbfaa17998ed0cb8b22132d8e824b274ac5f038cc (diff)
downloadhaskell-1ae5fa451f4f554e0d652d55f9312a585188ce13.tar.gz
Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242)
* Deprecate -XOverlappingInstances * Update test suite. Several tests even had entirely unnecessary uses of -XOverlappingInstances * Update user manual with a careful description of the instance resolution story * Fix an outright bug in the handling of duplidate instances in GHCi, which are meant to silently overwrite the earlier duplicate. The logic was right for family instances but was both more complicated, and plain wrong, for class instances. (If you are interested, the bug was that we were eliminating the duplicate from the InstEnv, but not from the [ClsInst] held in tcg_insts.) Test is ghci044a.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/deriving/should_compile/T4966.hs5
-rw-r--r--testsuite/tests/deriving/should_compile/T4966.stderr2
-rw-r--r--testsuite/tests/generics/Uniplate/GUniplate.hs6
-rw-r--r--testsuite/tests/ghci.debugger/scripts/print019.stderr4
-rw-r--r--testsuite/tests/ghci/prog007/C.hs2
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
-rw-r--r--testsuite/tests/ghci/scripts/ghci044.script19
-rw-r--r--testsuite/tests/ghci/scripts/ghci044.stderr17
-rw-r--r--testsuite/tests/ghci/scripts/ghci044a.hs9
-rw-r--r--testsuite/tests/ghci/scripts/ghci044a.script9
-rw-r--r--testsuite/tests/ghci/scripts/ghci044a.stdout2
-rw-r--r--testsuite/tests/ghci/scripts/ghci047.script6
-rw-r--r--testsuite/tests/indexed-types/should_compile/Gentle.hs2
-rw-r--r--testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs2
-rw-r--r--testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4246.hs6
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4485.hs9
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4485.stderr19
-rw-r--r--testsuite/tests/indexed-types/should_fail/T5439.hs1
-rw-r--r--testsuite/tests/indexed-types/should_fail/T5439.stderr52
-rw-r--r--testsuite/tests/perf/compiler/T5321FD.hs2
-rw-r--r--testsuite/tests/perf/compiler/T5321Fun.hs2
-rw-r--r--testsuite/tests/roles/should_compile/T8958.stderr2
-rw-r--r--testsuite/tests/safeHaskell/ghci/p13.script3
-rw-r--r--testsuite/tests/safeHaskell/ghci/p13.stderr9
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeInfered08_A.hs1
-rw-r--r--testsuite/tests/safeHaskell/safeLanguage/SafeLang10.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeLanguage/SafeLang10_B.hs5
-rw-r--r--testsuite/tests/simplCore/should_compile/T5359b.hs1
-rw-r--r--testsuite/tests/simplCore/should_compile/T5359b.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/simpl007.hs4
-rw-r--r--testsuite/tests/th/T4135a.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/FD4.hs1
-rw-r--r--testsuite/tests/typecheck/should_compile/LoopOfTheDay3.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/Makefile4
-rw-r--r--testsuite/tests/typecheck/should_compile/T1470.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/T3018.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/T3108.hs14
-rw-r--r--testsuite/tests/typecheck/should_compile/Tc173a.hs5
-rw-r--r--testsuite/tests/typecheck/should_compile/Tc173b.hs1
-rw-r--r--testsuite/tests/typecheck/should_compile/tc176.hs6
-rw-r--r--testsuite/tests/typecheck/should_compile/tc179.hs7
-rw-r--r--testsuite/tests/typecheck/should_fail/LongWayOverlapping.hs1
-rw-r--r--testsuite/tests/typecheck/should_fail/LongWayOverlapping.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T2307.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5051.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T5051.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5095.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T5095.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail121.hs6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail121.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail202.hs2
52 files changed, 154 insertions, 141 deletions
diff --git a/testsuite/tests/deriving/should_compile/T4966.hs b/testsuite/tests/deriving/should_compile/T4966.hs
index d7328c6ef6..363627a415 100644
--- a/testsuite/tests/deriving/should_compile/T4966.hs
+++ b/testsuite/tests/deriving/should_compile/T4966.hs
@@ -2,7 +2,6 @@
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
-{-# LANGUAGE OverlappingInstances #-}
module HTk.Toolkit.TreeList (getObjectFromTreeList) where
@@ -10,7 +9,7 @@ class Eq c => CItem c
-- A bizarre instance decl!
-- People who use instance decls like this are asking for trouble
-instance GUIObject w => Eq w where
+instance {-# OVERLAPPABLE #-} GUIObject w => Eq w where
w1 == w2 = toGUIObject w1 == toGUIObject w2
data StateEntry a
@@ -31,7 +30,7 @@ getObjectFromTreeList state = state == state
data CItem a => TreeListObject a
-instance CItem a => Eq (TreeListObject a)
+instance {-# OVERLAPPING #-} CItem a => Eq (TreeListObject a)
class GUIObject w where
toGUIObject :: w -> GUIOBJECT
diff --git a/testsuite/tests/deriving/should_compile/T4966.stderr b/testsuite/tests/deriving/should_compile/T4966.stderr
index d5cc4a24b2..dceeaa698f 100644
--- a/testsuite/tests/deriving/should_compile/T4966.stderr
+++ b/testsuite/tests/deriving/should_compile/T4966.stderr
@@ -2,7 +2,7 @@
T4966.hs:1:14: Warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
-T4966.hs:34:10: Warning:
+T4966.hs:33:30: Warning:
No explicit implementation for
either ‘==’ or ‘/=’
In the instance declaration for ‘Eq (TreeListObject a)’
diff --git a/testsuite/tests/generics/Uniplate/GUniplate.hs b/testsuite/tests/generics/Uniplate/GUniplate.hs
index 76f387d636..99b0b405a8 100644
--- a/testsuite/tests/generics/Uniplate/GUniplate.hs
+++ b/testsuite/tests/generics/Uniplate/GUniplate.hs
@@ -4,7 +4,8 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DefaultSignatures #-}
-{-# LANGUAGE IncoherentInstances #-} -- necessary, unfortunately
+{- # LANGUAGE IncoherentInstances #-} -- necessary, unfortunately
+{-# LANGUAGE OverlappingInstances #-}
module GUniplate where
@@ -20,7 +21,8 @@ class Uniplate' f b where
instance Uniplate' U1 a where
children' U1 = []
-instance Uniplate' (K1 i a) a where
+instance {-# OVERLAPPING #-} Uniplate' (K1 i a) a where
+ -- overlaps the (Uniplate' (K1 i a) b) instance
children' (K1 a) = [a]
instance Uniplate' (K1 i a) b where
diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr
index e6a9159836..e364f06f03 100644
--- a/testsuite/tests/ghci.debugger/scripts/print019.stderr
+++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr
@@ -5,8 +5,8 @@
Use :print or :force to determine these types
Relevant bindings include it :: a1 (bound at <interactive>:11:1)
Note: there are several potential instances:
- instance Show a => Show (List1 a) -- Defined at ../Test.hs:11:12
- instance Show MyInt -- Defined at ../Test.hs:14:16
+ instance Show Unary -- Defined at ../Test.hs:37:29
+ instance Show a => Show (MkT2 a) -- Defined at ../Test.hs:20:12
instance Show a => Show (MkT a) -- Defined at ../Test.hs:17:13
...plus 31 others
In a stmt of an interactive GHCi command: print it
diff --git a/testsuite/tests/ghci/prog007/C.hs b/testsuite/tests/ghci/prog007/C.hs
index 8273d6bdda..a66d000e8e 100644
--- a/testsuite/tests/ghci/prog007/C.hs
+++ b/testsuite/tests/ghci/prog007/C.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE OverlappingInstances #-}
-
module C where
import A
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index d1e67ebeca..d5a313a328 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -61,6 +61,7 @@ test('ghci041', normal, ghci_script, ['ghci041.script'])
test('ghci042', normal, ghci_script, ['ghci042.script'])
test('ghci043', normal, ghci_script, ['ghci043.script'])
test('ghci044', normal, ghci_script, ['ghci044.script'])
+test('ghci044a', normal, ghci_script, ['ghci044a.script'])
test('ghci045', normal, ghci_script, ['ghci045.script'])
test('ghci046', normal, ghci_script, ['ghci046.script'])
test('ghci047', normal, ghci_script, ['ghci047.script'])
diff --git a/testsuite/tests/ghci/scripts/ghci044.script b/testsuite/tests/ghci/scripts/ghci044.script
index 7af66bb935..b89ede3768 100644
--- a/testsuite/tests/ghci/scripts/ghci044.script
+++ b/testsuite/tests/ghci/scripts/ghci044.script
@@ -1,10 +1,13 @@
--Testing flexible and Overlapping instances
-class C a where { f :: a -> Int; f _ = 3 }
-instance C Int where { f = id }
-instance C [Int]
+class C a where { f :: a -> String; f _ = "Default" }
+instance C Int where { f _ = "Zeroth" }
:set -XFlexibleInstances
-instance C [Int]
-instance C a => C [a] where f xs = length xs
--- ***This should be an overlapping instances error!***
-:set -XOverlappingInstances
-instance C a => C [a] where f xs = length xs
+instance C [Int] where f _ = "First"
+f [3::Int]
+instance C a => C [a] where f xs = "Second"
+f [4::Int] -- ***This should be an overlapping instances error!***
+instance {-# OVERLAPPABLE #-} C a => C [a] where f xs = "Third"
+f [5::Int] -- Should be fine
+instance {-# OVERLAPPABLE #-} C a => C [a] where f xs = "Fourth"
+f [6::Int] -- Should be fine too, overrides
+
diff --git a/testsuite/tests/ghci/scripts/ghci044.stderr b/testsuite/tests/ghci/scripts/ghci044.stderr
index c319dd1f1c..9bc8df9994 100644
--- a/testsuite/tests/ghci/scripts/ghci044.stderr
+++ b/testsuite/tests/ghci/scripts/ghci044.stderr
@@ -1,13 +1,8 @@
-<interactive>:5:10:
- Illegal instance declaration for ‘C [Int]’
- (All instance types must be of the form (T a1 ... an)
- where a1 ... an are *distinct type variables*,
- and each type variable appears at most once in the instance head.
- Use FlexibleInstances if you want to disable this.)
- In the instance declaration for ‘C [Int]’
-
-<interactive>:7:10:
- Overlapping instance declarations:
- instance C [Int] -- Defined at <interactive>:7:10
+<interactive>:9:1:
+ Overlapping instances for C [Int] arising from a use of ‘f’
+ Matching instances:
+ instance C [Int] -- Defined at <interactive>:6:10
instance C a => C [a] -- Defined at <interactive>:8:10
+ In the expression: f [4 :: Int]
+ In an equation for ‘it’: it = f [4 :: Int]
diff --git a/testsuite/tests/ghci/scripts/ghci044a.hs b/testsuite/tests/ghci/scripts/ghci044a.hs
new file mode 100644
index 0000000000..ac400d3ef9
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/ghci044a.hs
@@ -0,0 +1,9 @@
+--Testing flexible and Overlapping instances
+class C a where { f :: a -> String; f _ = 3 }
+instance C Int where { f = id }
+:set -XFlexibleInstances
+instance C [Int] where f _ = "First"
+f [3::Int]
+-- Should override the identical one preceding
+instance C [Int] where f _ = "Second"
+f [3::Int]
diff --git a/testsuite/tests/ghci/scripts/ghci044a.script b/testsuite/tests/ghci/scripts/ghci044a.script
new file mode 100644
index 0000000000..d78c5c25bc
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/ghci044a.script
@@ -0,0 +1,9 @@
+--Testing flexible and Overlapping instances
+class C a where { f :: a -> String; f _ = "Default" }
+instance C Int where { f _ = "Zeroth" }
+:set -XFlexibleInstances
+instance C [Int] where f _ = "First"
+f [3::Int]
+-- Should override the identical one preceding
+instance C [Int] where f _ = "Second"
+f [3::Int]
diff --git a/testsuite/tests/ghci/scripts/ghci044a.stdout b/testsuite/tests/ghci/scripts/ghci044a.stdout
new file mode 100644
index 0000000000..fe475f4745
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/ghci044a.stdout
@@ -0,0 +1,2 @@
+"First"
+"Second"
diff --git a/testsuite/tests/ghci/scripts/ghci047.script b/testsuite/tests/ghci/scripts/ghci047.script
index 49d93047f6..70cc5181d8 100644
--- a/testsuite/tests/ghci/scripts/ghci047.script
+++ b/testsuite/tests/ghci/scripts/ghci047.script
@@ -1,7 +1,6 @@
--Testing GADTs, type families as well as a ton of crazy type stuff
:set -XGADTs
:set -XTypeFamilies
-:set -XOverlappingInstances
:set -XFunctionalDependencies
:set -XFlexibleContexts
:set -XFlexibleInstances
@@ -22,8 +21,9 @@ data HTrue
data HFalse
class TypeEq x y b | x y -> b
-instance (HTrue ~ b) => TypeEq x x b
-instance (HFalse ~ b) => TypeEq x y b
+instance {-# OVERLAPS #-} (HTrue ~ b) => TypeEq x x b
+instance {-# OVERLAPS #-} (HTrue ~ b) => TypeEq x x b
+instance {-# OVERLAPS #-} (HFalse ~ b) => TypeEq x y b
type family Or a b
type instance Or HTrue HTrue = HTrue
diff --git a/testsuite/tests/indexed-types/should_compile/Gentle.hs b/testsuite/tests/indexed-types/should_compile/Gentle.hs
index 6cc1512a1f..7ceedfd098 100644
--- a/testsuite/tests/indexed-types/should_compile/Gentle.hs
+++ b/testsuite/tests/indexed-types/should_compile/Gentle.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances,
- OverlappingInstances, UndecidableInstances #-}
+ UndecidableInstances #-}
-- Rather exotic example posted to Haskell mailing list 17 Oct 07
-- It concerns context reduction and functional dependencies
diff --git a/testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs b/testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs
index dbba60d595..e37bfe323e 100644
--- a/testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs
+++ b/testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE EmptyDataDecls, TypeFamilies, UndecidableInstances,
- ScopedTypeVariables, OverlappingInstances, TypeOperators,
+ ScopedTypeVariables, TypeOperators,
FlexibleInstances, NoMonomorphismRestriction,
MultiParamTypeClasses, FlexibleContexts #-}
module IndTypesPerfMerge where
diff --git a/testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs b/testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs
index dc0ae5392a..26ea632a29 100644
--- a/testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs
+++ b/testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE TypeFamilies, EmptyDataDecls, FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-}
+{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
module NonLinearLHS where
diff --git a/testsuite/tests/indexed-types/should_fail/T4246.hs b/testsuite/tests/indexed-types/should_fail/T4246.hs
index b5c37a68e3..60b56405ad 100644
--- a/testsuite/tests/indexed-types/should_fail/T4246.hs
+++ b/testsuite/tests/indexed-types/should_fail/T4246.hs
@@ -1,13 +1,13 @@
-{-# LANGUAGE TypeFamilies, FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE TypeFamilies, FlexibleInstances #-}
module T4246 where
class Stupid a where
type F a
-instance Stupid a where
+instance {-# OVERLAPPABLE #-} Stupid a where
type F a = a
-instance Stupid Int where
+instance {-# OVERLAPPING #-} Stupid Int where
type F Int = Bool
type family G a :: *
diff --git a/testsuite/tests/indexed-types/should_fail/T4485.hs b/testsuite/tests/indexed-types/should_fail/T4485.hs
index b48e8206f2..d7d4730362 100644
--- a/testsuite/tests/indexed-types/should_fail/T4485.hs
+++ b/testsuite/tests/indexed-types/should_fail/T4485.hs
@@ -11,7 +11,6 @@
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses
, FlexibleContexts, FlexibleInstances, UndecidableInstances
, TypeSynonymInstances, GeneralizedNewtypeDeriving
- , OverlappingInstances
#-}
module XMLGenerator where
@@ -26,9 +25,9 @@ class Monad m => XMLGen m where
class XMLGen m => EmbedAsChild m c where
asChild :: c -> XMLGenT m [Child m]
-instance (EmbedAsChild m c, m1 ~ m) => EmbedAsChild m (XMLGenT m1 c)
+instance {-# OVERLAPPING #-} (EmbedAsChild m c, m1 ~ m) => EmbedAsChild m (XMLGenT m1 c)
-instance (XMLGen m, XML m ~ x) => EmbedAsChild m x
+instance {-# OVERLAPPABLE #-} (XMLGen m, XML m ~ x) => EmbedAsChild m x
data Xml = Xml
data IdentityT m a = IdentityT (m a)
@@ -39,11 +38,11 @@ instance XMLGen (IdentityT m) where
data Identity a = Identity a
instance Monad Identity
-instance EmbedAsChild (IdentityT IO) (XMLGenT Identity ())
+instance {-# OVERLAPPING #-} EmbedAsChild (IdentityT IO) (XMLGenT Identity ())
data FooBar = FooBar
-instance EmbedAsChild (IdentityT IO) FooBar where
+instance {-# OVERLAPPING #-} EmbedAsChild (IdentityT IO) FooBar where
asChild b = asChild $ (genElement "foo")
-- asChild :: FooBar -> XMLGenT (XMLGenT (IdentityT IO) [Child (IdentitiyT IO)])
diff --git a/testsuite/tests/indexed-types/should_fail/T4485.stderr b/testsuite/tests/indexed-types/should_fail/T4485.stderr
index b2bd626d20..760cdf912d 100644
--- a/testsuite/tests/indexed-types/should_fail/T4485.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4485.stderr
@@ -1,15 +1,15 @@
-T4485.hs:47:15:
+T4485.hs:46:15:
Overlapping instances for EmbedAsChild
(IdentityT IO) (XMLGenT m0 (XML m0))
arising from a use of ‘asChild’
Matching instances:
- instance [overlap ok] (EmbedAsChild m c, m1 ~ m) =>
- EmbedAsChild m (XMLGenT m1 c)
- -- Defined at T4485.hs:29:10
- instance [overlap ok] EmbedAsChild
- (IdentityT IO) (XMLGenT Identity ())
- -- Defined at T4485.hs:42:10
+ instance [overlapping] (EmbedAsChild m c, m1 ~ m) =>
+ EmbedAsChild m (XMLGenT m1 c)
+ -- Defined at T4485.hs:28:30
+ instance [overlapping] EmbedAsChild
+ (IdentityT IO) (XMLGenT Identity ())
+ -- Defined at T4485.hs:41:30
(The choice depends on the instantiation of ‘m0’
To pick the first instance above, use IncoherentInstances
when compiling the other instance declarations)
@@ -18,12 +18,11 @@ T4485.hs:47:15:
In an equation for ‘asChild’:
asChild b = asChild $ (genElement "foo")
-T4485.hs:47:26:
+T4485.hs:46:26:
No instance for (XMLGen m0) arising from a use of ‘genElement’
The type variable ‘m0’ is ambiguous
Note: there is a potential instance available:
- instance [overlap ok] XMLGen (IdentityT m)
- -- Defined at T4485.hs:36:10
+ instance XMLGen (IdentityT m) -- Defined at T4485.hs:35:10
In the second argument of ‘($)’, namely ‘(genElement "foo")’
In the expression: asChild $ (genElement "foo")
In an equation for ‘asChild’:
diff --git a/testsuite/tests/indexed-types/should_fail/T5439.hs b/testsuite/tests/indexed-types/should_fail/T5439.hs
index 396a5436c4..dfcd399b4f 100644
--- a/testsuite/tests/indexed-types/should_fail/T5439.hs
+++ b/testsuite/tests/indexed-types/should_fail/T5439.hs
@@ -9,7 +9,6 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module Main where
diff --git a/testsuite/tests/indexed-types/should_fail/T5439.stderr b/testsuite/tests/indexed-types/should_fail/T5439.stderr
index 18af3fa7cf..19517cbf57 100644
--- a/testsuite/tests/indexed-types/should_fail/T5439.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T5439.stderr
@@ -1,26 +1,26 @@
-
-T5439.hs:83:28:
- Couldn't match type ‘Attempt (HHead (HDrop n0 l0))
- -> Attempt (HElemOf l0)’
- with ‘Attempt (WaitOpResult (WaitOps rs))’
- Expected type: f (Attempt (HNth n0 l0) -> Attempt (HElemOf l0))
- Actual type: f (Attempt (WaitOpResult (WaitOps rs)))
- Relevant bindings include
- register :: Bool -> Peano n -> WaitOps (HDrop n rs) -> IO Bool
- (bound at T5439.hs:65:9)
- ev :: f (Attempt (WaitOpResult (WaitOps rs)))
- (bound at T5439.hs:62:22)
- ops :: WaitOps rs (bound at T5439.hs:62:18)
- registerWaitOp :: WaitOps rs
- -> f (Attempt (WaitOpResult (WaitOps rs))) -> IO Bool
- (bound at T5439.hs:62:3)
- In the first argument of ‘complete’, namely ‘ev’
- In the expression: complete ev
-
-T5439.hs:83:39:
- Couldn't match expected type ‘Peano n0’
- with actual type ‘Attempt α0’
- In the second argument of ‘($)’, namely
- ‘Failure (e :: SomeException)’
- In the second argument of ‘($)’, namely
- ‘inj $ Failure (e :: SomeException)’
+
+T5439.hs:82:28:
+ Couldn't match type ‘Attempt (HHead (HDrop n0 l0))
+ -> Attempt (HElemOf l0)’
+ with ‘Attempt (WaitOpResult (WaitOps rs))’
+ Expected type: f (Attempt (HNth n0 l0) -> Attempt (HElemOf l0))
+ Actual type: f (Attempt (WaitOpResult (WaitOps rs)))
+ Relevant bindings include
+ register :: Bool -> Peano n -> WaitOps (HDrop n rs) -> IO Bool
+ (bound at T5439.hs:64:9)
+ ev :: f (Attempt (WaitOpResult (WaitOps rs)))
+ (bound at T5439.hs:61:22)
+ ops :: WaitOps rs (bound at T5439.hs:61:18)
+ registerWaitOp :: WaitOps rs
+ -> f (Attempt (WaitOpResult (WaitOps rs))) -> IO Bool
+ (bound at T5439.hs:61:3)
+ In the first argument of ‘complete’, namely ‘ev’
+ In the expression: complete ev
+
+T5439.hs:82:39:
+ Couldn't match expected type ‘Peano n0’
+ with actual type ‘Attempt α0’
+ In the second argument of ‘($)’, namely
+ ‘Failure (e :: SomeException)’
+ In the second argument of ‘($)’, namely
+ ‘inj $ Failure (e :: SomeException)’
diff --git a/testsuite/tests/perf/compiler/T5321FD.hs b/testsuite/tests/perf/compiler/T5321FD.hs
index 6e10939837..004f487098 100644
--- a/testsuite/tests/perf/compiler/T5321FD.hs
+++ b/testsuite/tests/perf/compiler/T5321FD.hs
@@ -1,7 +1,7 @@
{-# OPTIONS_GHC -fcontext-stack=1000 #-}
{-# LANGUAGE
FlexibleContexts, FlexibleInstances, FunctionalDependencies,
- MultiParamTypeClasses, OverlappingInstances, TypeSynonymInstances,
+ MultiParamTypeClasses, TypeSynonymInstances,
TypeOperators, UndecidableInstances, TypeFamilies #-}
module T5321FD where
diff --git a/testsuite/tests/perf/compiler/T5321Fun.hs b/testsuite/tests/perf/compiler/T5321Fun.hs
index efd7db770b..bf70ce5221 100644
--- a/testsuite/tests/perf/compiler/T5321Fun.hs
+++ b/testsuite/tests/perf/compiler/T5321Fun.hs
@@ -1,7 +1,7 @@
{-# OPTIONS_GHC -fcontext-stack=1000 #-}
{-# LANGUAGE
FlexibleContexts, FlexibleInstances, FunctionalDependencies,
- MultiParamTypeClasses, OverlappingInstances, TypeSynonymInstances,
+ MultiParamTypeClasses, TypeSynonymInstances,
TypeOperators, UndecidableInstances, TypeFamilies #-}
module T5321Fun where
diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr
index d400b9190c..b53df162a8 100644
--- a/testsuite/tests/roles/should_compile/T8958.stderr
+++ b/testsuite/tests/roles/should_compile/T8958.stderr
@@ -12,9 +12,9 @@ TYPE CONSTRUCTORS
COERCION AXIOMS
axiom T8958.NTCo:Map :: Map k v = [(k, v)]
INSTANCES
+ instance [incoherent] Nominal a -- Defined at T8958.hs:7:10
instance [incoherent] Representational a
-- Defined at T8958.hs:10:10
- instance [incoherent] Nominal a -- Defined at T8958.hs:7:10
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
diff --git a/testsuite/tests/safeHaskell/ghci/p13.script b/testsuite/tests/safeHaskell/ghci/p13.script
index 4e96c844ed..950f95ab67 100644
--- a/testsuite/tests/safeHaskell/ghci/p13.script
+++ b/testsuite/tests/safeHaskell/ghci/p13.script
@@ -1,12 +1,11 @@
-- Test restricted functionality: Overlapping
:unset +s
:set -XSafe
-:set -XOverlappingInstances
:set -XFlexibleInstances
:l P13_A
-instance Pos [Int] where { res _ = error "This curry is poisoned!" }
+instance {-# OVERLAPPING #-} Pos [Int] where { res _ = error "This curry is poisoned!" }
res [1::Int, 2::Int]
-- res 'c'
diff --git a/testsuite/tests/safeHaskell/ghci/p13.stderr b/testsuite/tests/safeHaskell/ghci/p13.stderr
index edf5e1eb91..44f8ff4ac0 100644
--- a/testsuite/tests/safeHaskell/ghci/p13.stderr
+++ b/testsuite/tests/safeHaskell/ghci/p13.stderr
@@ -1,10 +1,13 @@
-<interactive>:12:1:
+P13_A.hs:1:14: Warning:
+ -XOverlappingInstances is deprecated: instead use per-instance pragamas OVERLAPPING/OVERLAPPABLE/OVERLAPS
+
+<interactive>:11:1:
Unsafe overlapping instances for Pos [Int]
arising from a use of ‘res’
The matching instance is:
- instance [overlap ok] [safe] Pos [Int]
- -- Defined at <interactive>:10:10
+ instance [overlapping] [safe] Pos [Int]
+ -- Defined at <interactive>:9:30
It is compiled in a Safe module and as such can only
overlap instances from the same module, however it
overlaps the following instances from different modules:
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered08_A.hs b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered08_A.hs
index 13f22ce3d7..4cd276fafd 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered08_A.hs
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered08_A.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE OverlappingInstances #-}
+{-# OPTIONS_GHC -w #-} -- Turn off deprecation for OverlappingInstances
-- | Unsafe as uses overlapping instances
-- Although it isn't defining any so can we mark safe
-- still?
diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang10.stderr b/testsuite/tests/safeHaskell/safeLanguage/SafeLang10.stderr
index 83c79da75f..d0c5c68d6a 100644
--- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang10.stderr
+++ b/testsuite/tests/safeHaskell/safeLanguage/SafeLang10.stderr
@@ -6,8 +6,8 @@ SafeLang10.hs:8:13:
Unsafe overlapping instances for Pos [Int]
arising from a use of ‘res’
The matching instance is:
- instance [overlap ok] [safe] Pos [Int]
- -- Defined at SafeLang10_B.hs:14:10
+ instance [overlapping] [safe] Pos [Int]
+ -- Defined at SafeLang10_B.hs:13:30
It is compiled in a Safe module and as such can only
overlap instances from the same module, however it
overlaps the following instances from different modules:
diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang10_B.hs b/testsuite/tests/safeHaskell/safeLanguage/SafeLang10_B.hs
index 5b9954c12e..d9a8f63f50 100644
--- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang10_B.hs
+++ b/testsuite/tests/safeHaskell/safeLanguage/SafeLang10_B.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE Safe #-}
-- Untrusted plugin! Don't wan't it changing behaviour of our
@@ -8,10 +7,10 @@ module SafeLang10_B where
import SafeLang10_A
-instance Pos a where
+instance {-# OVERLAPPABLE #-} Pos a where
res _ = False
-instance Pos [Int] where
+instance {-# OVERLAPPING #-} Pos [Int] where
res _ = error "This curry is poisoned!"
function :: Int
diff --git a/testsuite/tests/simplCore/should_compile/T5359b.hs b/testsuite/tests/simplCore/should_compile/T5359b.hs
index 6348defdd1..f1ce2091a9 100644
--- a/testsuite/tests/simplCore/should_compile/T5359b.hs
+++ b/testsuite/tests/simplCore/should_compile/T5359b.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE TypeFamilies #-}
-{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
diff --git a/testsuite/tests/simplCore/should_compile/T5359b.stderr b/testsuite/tests/simplCore/should_compile/T5359b.stderr
index 75dde28fcc..2802476a2d 100644
--- a/testsuite/tests/simplCore/should_compile/T5359b.stderr
+++ b/testsuite/tests/simplCore/should_compile/T5359b.stderr
@@ -1,3 +1,3 @@
-T5359b.hs:62:1: Warning:
+T5359b.hs:61:1: Warning:
SPECIALISE pragma on INLINE function probably won't fire: ‘genum’
diff --git a/testsuite/tests/simplCore/should_compile/simpl007.hs b/testsuite/tests/simplCore/should_compile/simpl007.hs
index 2b42cc29ee..c7277b7f66 100644
--- a/testsuite/tests/simplCore/should_compile/simpl007.hs
+++ b/testsuite/tests/simplCore/should_compile/simpl007.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverlappingInstances, UndecidableInstances,
+{-# LANGUAGE UndecidableInstances,
ExistentialQuantification, FlexibleInstances #-}
-- module Formula where
@@ -186,7 +186,7 @@ class AddT a where
addT :: a -> Formula -> Maybe Formula
addT _ _ = Nothing
-instance (FORMULA a) => AddT a where {}
+instance {-# OVERLAPPABLE #-} (FORMULA a) => AddT a where {}
instance AddT Formula where
addT (Formula f) = addT f
diff --git a/testsuite/tests/th/T4135a.hs b/testsuite/tests/th/T4135a.hs
index 41549cad40..d78de088a0 100644
--- a/testsuite/tests/th/T4135a.hs
+++ b/testsuite/tests/th/T4135a.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, TypeFamilies,
- FlexibleInstances, OverlappingInstances #-}
+ FlexibleInstances #-}
module T4135a where
diff --git a/testsuite/tests/typecheck/should_compile/FD4.hs b/testsuite/tests/typecheck/should_compile/FD4.hs
index 5d5869ca01..dcf25f7293 100644
--- a/testsuite/tests/typecheck/should_compile/FD4.hs
+++ b/testsuite/tests/typecheck/should_compile/FD4.hs
@@ -2,7 +2,6 @@
MultiParamTypeClasses,
FunctionalDependencies,
UndecidableInstances,
- OverlappingInstances,
FlexibleInstances,
EmptyDataDecls #-}
diff --git a/testsuite/tests/typecheck/should_compile/LoopOfTheDay3.hs b/testsuite/tests/typecheck/should_compile/LoopOfTheDay3.hs
index dce1601a70..f1c1b49839 100644
--- a/testsuite/tests/typecheck/should_compile/LoopOfTheDay3.hs
+++ b/testsuite/tests/typecheck/should_compile/LoopOfTheDay3.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances,
- OverlappingInstances, UndecidableInstances #-}
+ UndecidableInstances #-}
-- Instances compile fine but instance selection loops in GHC 6.2.
-- try: :t foo (T1a 1)
diff --git a/testsuite/tests/typecheck/should_compile/Makefile b/testsuite/tests/typecheck/should_compile/Makefile
index 518f923689..e361556f8f 100644
--- a/testsuite/tests/typecheck/should_compile/Makefile
+++ b/testsuite/tests/typecheck/should_compile/Makefile
@@ -9,8 +9,8 @@ tc170:
tc173:
$(RM) Tc173a.o Tc173a.hi Tc173b.o Tc173b.hi
- '$(TEST_HC)' $(TEST_HC_OPTS) -c -XFlexibleInstances -XTypeSynonymInstances -XUndecidableInstances -XOverlappingInstances Tc173a.hs
- '$(TEST_HC)' $(TEST_HC_OPTS) -c -XUndecidableInstances -XOverlappingInstances Tc173b.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Tc173a.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Tc173b.hs
T2412:
$(RM) -f T2412.hi-boot T2412.o-boot T2412A.hi T2412A.o T2412.hi T2412.o
diff --git a/testsuite/tests/typecheck/should_compile/T1470.hs b/testsuite/tests/typecheck/should_compile/T1470.hs
index d466e487e9..2482696452 100644
--- a/testsuite/tests/typecheck/should_compile/T1470.hs
+++ b/testsuite/tests/typecheck/should_compile/T1470.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, OverlappingInstances, UndecidableInstances, KindSignatures #-}
+{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, UndecidableInstances, KindSignatures #-}
-- Trac #1470
@@ -15,10 +15,9 @@ data FooD a = FooD
instance Foo t => Sat (FooD t)
-instance Data FooD a => Foo a
-
-
-instance Foo a => Foo [a]
+instance {-# OVERLAPPABLE #-} Data FooD a => Foo a
+instance {-# OVERLAPS #-} Foo a => Foo [a]
+instance {-# OVERLAPPING #-} Foo [Char]
{-
Given: Foo a,
and its superclasses: Data FooD a
@@ -35,4 +34,3 @@ instance Foo a => Foo [a]
BUT THIS INSTANCE OVERLAPS
-}
-instance Foo [Char]
diff --git a/testsuite/tests/typecheck/should_compile/T3018.hs b/testsuite/tests/typecheck/should_compile/T3018.hs
index a0868afa24..443d73a17a 100644
--- a/testsuite/tests/typecheck/should_compile/T3018.hs
+++ b/testsuite/tests/typecheck/should_compile/T3018.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverlappingInstances , UndecidableInstances, EmptyDataDecls #-}
+{-# LANGUAGE UndecidableInstances, EmptyDataDecls #-}
{-# LANGUAGE RankNTypes, KindSignatures, MultiParamTypeClasses, FlexibleInstances #-}
-- Works with new constraint solver
diff --git a/testsuite/tests/typecheck/should_compile/T3108.hs b/testsuite/tests/typecheck/should_compile/T3108.hs
index 774d5f3801..2adaa1aef7 100644
--- a/testsuite/tests/typecheck/should_compile/T3108.hs
+++ b/testsuite/tests/typecheck/should_compile/T3108.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverlappingInstances, UndecidableInstances, MultiParamTypeClasses,
+{-# LANGUAGE UndecidableInstances, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances #-}
module T3108 where
@@ -10,9 +10,9 @@ class C0 x
m0 :: x -> ()
m0 = const undefined
-instance (C0 x, C0 y) => C0 (x,y)
-instance C0 Bool
-instance C0 (x,Bool) => C0 x
+instance {-# OVERLAPPING #-} (C0 x, C0 y) => C0 (x,y)
+instance {-# OVERLAPPING #-} C0 Bool
+instance {-# OVERLAPPABLE #-} C0 (x,Bool) => C0 x
foo :: ()
foo = m0 (1::Int)
@@ -25,9 +25,9 @@ class C1 x
m1 :: x -> ()
m1 = const undefined
-instance (C1 x, C1 y) => C1 (x,y)
-instance C1 Bool
-instance (C2 x y, C1 (y,Bool)) => C1 x
+instance {-# OVERLAPPING #-} (C1 x, C1 y) => C1 (x,y)
+instance {-# OVERLAPPING #-} C1 Bool
+instance {-# OVERLAPPABLE #-} (C2 x y, C1 (y,Bool)) => C1 x
class C2 x y | x -> y
instance C2 Int Int
diff --git a/testsuite/tests/typecheck/should_compile/Tc173a.hs b/testsuite/tests/typecheck/should_compile/Tc173a.hs
index c8a589d2b3..f3704ccd9a 100644
--- a/testsuite/tests/typecheck/should_compile/Tc173a.hs
+++ b/testsuite/tests/typecheck/should_compile/Tc173a.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, UndecidableInstances #-}
module Tc173a where
class FormValue value where
@@ -8,10 +9,10 @@ class FormTextField value
instance FormTextField String
-instance FormTextField value => FormTextFieldIO value
+instance {-# OVERLAPPABLE #-} FormTextField value => FormTextFieldIO value
class FormTextFieldIO value
instance FormTextFieldIO value => FormValue value
-instance FormTextFieldIO value => FormTextFieldIO (Maybe value)
+instance {-# OVERLAPPING #-} FormTextFieldIO value => FormTextFieldIO (Maybe value)
diff --git a/testsuite/tests/typecheck/should_compile/Tc173b.hs b/testsuite/tests/typecheck/should_compile/Tc173b.hs
index c98c57acd8..d14663d866 100644
--- a/testsuite/tests/typecheck/should_compile/Tc173b.hs
+++ b/testsuite/tests/typecheck/should_compile/Tc173b.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE UndecidableInstances #-}
module Tc173b where
import Tc173a
diff --git a/testsuite/tests/typecheck/should_compile/tc176.hs b/testsuite/tests/typecheck/should_compile/tc176.hs
index d05ccdbe29..94fdcb2227 100644
--- a/testsuite/tests/typecheck/should_compile/tc176.hs
+++ b/testsuite/tests/typecheck/should_compile/tc176.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
{- With "hugs -98 +o test.hs" gives me:
ERROR "test.hs":8 - Cannot justify constraints in instance member binding
@@ -29,8 +29,8 @@ class FromStr a where
typeError :: FromStr a => a -> a
typeError t = error "type error"
-instance FromStr [a] where
+instance {-# OVERLAPPABLE #-} FromStr [a] where
fromStr _ = typeError undefined -- line 8
-instance FromStr [(String,a)] where -- line 10
+instance {-# OVERLAPPING #-} FromStr [(String,a)] where -- line 10
fromStr _ = typeError undefined -- line 11
diff --git a/testsuite/tests/typecheck/should_compile/tc179.hs b/testsuite/tests/typecheck/should_compile/tc179.hs
index 110950587d..62db4726a0 100644
--- a/testsuite/tests/typecheck/should_compile/tc179.hs
+++ b/testsuite/tests/typecheck/should_compile/tc179.hs
@@ -1,5 +1,4 @@
-{-# LANGUAGE ExistentialQuantification, FlexibleInstances,
- OverlappingInstances, UndecidableInstances #-}
+{-# LANGUAGE ExistentialQuantification, FlexibleInstances, UndecidableInstances #-}
-- Tests context reduction for existentials
@@ -7,9 +6,9 @@ module TestWrappedNode where
class Foo a where { op :: a -> Int }
-instance Foo a => Foo [a] where -- NB overlap
+instance {-# OVERLAPPABLE #-} Foo a => Foo [a] where -- NB overlap
op (x:xs) = op x
-instance Foo [Int] where -- NB overlap
+instance {-# OVERLAPPING #-} Foo [Int] where -- NB overlap
op x = 1
data T = forall a. Foo a => MkT a
diff --git a/testsuite/tests/typecheck/should_fail/LongWayOverlapping.hs b/testsuite/tests/typecheck/should_fail/LongWayOverlapping.hs
index 4a79e69ed6..663143ceb4 100644
--- a/testsuite/tests/typecheck/should_fail/LongWayOverlapping.hs
+++ b/testsuite/tests/typecheck/should_fail/LongWayOverlapping.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses
, FlexibleContexts, FlexibleInstances, UndecidableInstances
, TypeSynonymInstances, GeneralizedNewtypeDeriving
- , OverlappingInstances
#-}
module LongWayOverlapping where
diff --git a/testsuite/tests/typecheck/should_fail/LongWayOverlapping.stderr b/testsuite/tests/typecheck/should_fail/LongWayOverlapping.stderr
index 753ee0f2af..f1eb2db530 100644
--- a/testsuite/tests/typecheck/should_fail/LongWayOverlapping.stderr
+++ b/testsuite/tests/typecheck/should_fail/LongWayOverlapping.stderr
@@ -1,5 +1,5 @@
-LongWayOverlapping.hs:23:11:
+LongWayOverlapping.hs:22:11:
No instance for (EmbAsChild [Char] Char)
arising from a use of ‘emb’
In the expression: emb 'c'
diff --git a/testsuite/tests/typecheck/should_fail/T2307.hs b/testsuite/tests/typecheck/should_fail/T2307.hs
index 321c2d5641..ea0c335a96 100644
--- a/testsuite/tests/typecheck/should_fail/T2307.hs
+++ b/testsuite/tests/typecheck/should_fail/T2307.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
- OverlappingInstances, UndecidableInstances,
+ UndecidableInstances,
IncoherentInstances,
FlexibleInstances #-}
diff --git a/testsuite/tests/typecheck/should_fail/T5051.hs b/testsuite/tests/typecheck/should_fail/T5051.hs
index 6c5faf9170..e3278d83d3 100644
--- a/testsuite/tests/typecheck/should_fail/T5051.hs
+++ b/testsuite/tests/typecheck/should_fail/T5051.hs
@@ -1,11 +1,11 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
-- A very delicate interaction of overlapping instances
module T5051 where
data T = T deriving( Eq, Ord )
-instance Eq [T]
+instance {-# OVERLAPPING #-} Eq [T]
foo :: Ord a => [a] -> Bool
foo x = x >= x
diff --git a/testsuite/tests/typecheck/should_fail/T5051.stderr b/testsuite/tests/typecheck/should_fail/T5051.stderr
index f6225ea406..3fc46f9e98 100644
--- a/testsuite/tests/typecheck/should_fail/T5051.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5051.stderr
@@ -3,7 +3,7 @@ T5051.hs:11:11:
Overlapping instances for Eq [a] arising from a use of ‘>=’
Matching instances:
instance Eq a => Eq [a] -- Defined in ‘GHC.Classes’
- instance [overlap ok] Eq [T] -- Defined at T5051.hs:8:10
+ instance [overlapping] Eq [T] -- Defined at T5051.hs:8:30
(The choice depends on the instantiation of ‘a’
To pick the first instance above, use IncoherentInstances
when compiling the other instance declarations)
diff --git a/testsuite/tests/typecheck/should_fail/T5095.hs b/testsuite/tests/typecheck/should_fail/T5095.hs
index 80e080802e..7942a87433 100644
--- a/testsuite/tests/typecheck/should_fail/T5095.hs
+++ b/testsuite/tests/typecheck/should_fail/T5095.hs
@@ -1,8 +1,8 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-}
+{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
module Test where
-instance Show a => Eq a where
+instance {-# OVERLAPPABLE #-} Show a => Eq a where
x == y = length (show x) == length (show y)
f :: Show a => a -> a -> Bool
diff --git a/testsuite/tests/typecheck/should_fail/T5095.stderr b/testsuite/tests/typecheck/should_fail/T5095.stderr
index 614c99cb11..a572c07788 100644
--- a/testsuite/tests/typecheck/should_fail/T5095.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5095.stderr
@@ -2,7 +2,7 @@
T5095.hs:9:11:
Overlapping instances for Eq a arising from a use of ‘==’
Matching instances:
- instance [overlap ok] Show a => Eq a -- Defined at T5095.hs:5:10
+ instance [overlappable] Show a => Eq a -- Defined at T5095.hs:5:31
instance Eq a => Eq (GHC.Real.Ratio a) -- Defined in ‘GHC.Real’
instance Eq () -- Defined in ‘GHC.Classes’
instance (Eq a, Eq b) => Eq (a, b) -- Defined in ‘GHC.Classes’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail121.hs b/testsuite/tests/typecheck/should_fail/tcfail121.hs
index 86c2a92c5c..84966c4e7e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail121.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail121.hs
@@ -1,13 +1,13 @@
-{-# LANGUAGE OverlappingInstances, FlexibleInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
module ShouldFail where
class Foo a where
op :: a -> a
-instance Foo a => Foo [a]
-instance Foo [Int]
+instance {-# OVERLAPPABLE #-} Foo a => Foo [a]
+instance {-# OVERLAPPING #-} Foo [Int]
foo :: Foo a => [a] -> [a]
foo x = op x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail121.stderr b/testsuite/tests/typecheck/should_fail/tcfail121.stderr
index bc71d5e79f..dc0679edca 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail121.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail121.stderr
@@ -2,9 +2,9 @@
tcfail121.hs:13:9:
Overlapping instances for Foo [a] arising from a use of ‘op’
Matching instances:
- instance [overlap ok] Foo a => Foo [a]
- -- Defined at tcfail121.hs:9:10
- instance [overlap ok] Foo [Int] -- Defined at tcfail121.hs:10:10
+ instance [overlappable] Foo a => Foo [a]
+ -- Defined at tcfail121.hs:9:31
+ instance [overlapping] Foo [Int] -- Defined at tcfail121.hs:10:30
(The choice depends on the instantiation of ‘a’
To pick the first instance above, use IncoherentInstances
when compiling the other instance declarations)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail202.hs b/testsuite/tests/typecheck/should_fail/tcfail202.hs
index 7565755218..6878e4ece6 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail202.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail202.hs
@@ -2,7 +2,7 @@
-- This was accepted due to a bug in GHC
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
- OverlappingInstances, UndecidableInstances, IncoherentInstances,
+ UndecidableInstances, IncoherentInstances,
FlexibleInstances #-}
module Foo where