summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc079.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc079.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc079.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc079.hs b/testsuite/tests/typecheck/should_compile/tc079.hs
new file mode 100644
index 0000000000..db07ad1325
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc079.hs
@@ -0,0 +1,16 @@
+-- !!! small class decl with local polymorphism;
+-- !!! "easy" to check default methods and such...
+-- !!! (this is the example given in TcClassDcl)
+--
+module ShouldSucceed where
+
+class Foo a where
+ op1 :: a -> Bool
+ op2 :: Ord b => a -> b -> b -> b
+
+ op1 x = True
+ op2 x y z = if (op1 x) && (y < z) then y else z
+
+instance Foo Int where {}
+
+instance Foo a => Foo [a] where {}