summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci044a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghci/scripts/ghci044a.hs')
-rw-r--r--testsuite/tests/ghci/scripts/ghci044a.hs9
1 files changed, 9 insertions, 0 deletions
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]