diff options
author | Daniel Winograd-Cort <dwc@cs.yale.edu> | 2011-08-25 17:30:41 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-09-21 01:14:32 +0100 |
commit | 0ce6b6c11c3df08edcc5a89190f56e5a4f2922e6 (patch) | |
tree | 918afcadddc6fba31a377cafa3af9f018e9126d0 /testsuite/tests/ghci/scripts/ghci044.script | |
parent | b4d342606fd0a1fc2300291036c52ca20de7c1ab (diff) | |
download | haskell-0ce6b6c11c3df08edcc5a89190f56e5a4f2922e6.tar.gz |
Test cases for GHCi data, class, etc.
Test cases for GHCi data, type, newtype, class, instance,
deriving, etc declarations.
Diffstat (limited to 'testsuite/tests/ghci/scripts/ghci044.script')
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci044.script | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/ghci044.script b/testsuite/tests/ghci/scripts/ghci044.script new file mode 100644 index 0000000000..7af66bb935 --- /dev/null +++ b/testsuite/tests/ghci/scripts/ghci044.script @@ -0,0 +1,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 |