summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci044.script
blob: 7af66bb9352fc9a172eefde979d7749d3438b9f0 (plain)
1
2
3
4
5
6
7
8
9
10
--Testing flexible and Overlapping instances
class C a where { f :: a -> Int; f _ = 3 }
instance C Int where { f = id }
instance C [Int]
: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