diff options
Diffstat (limited to 'testsuite/tests/ghci/scripts/ghci044a.script')
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci044a.script | 9 |
1 files changed, 9 insertions, 0 deletions
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] |