summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-09-07 16:13:34 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-09-07 16:13:34 +0100
commit400842c377bae85ffab6edc61af494cbe62123cb (patch)
tree95708fac10ed5745b7fc2f945c688bc2026db44f /testsuite/tests
parent8b5a2b4345ee9ba74f1274e7ed06e504240676c3 (diff)
downloadhaskell-400842c377bae85ffab6edc61af494cbe62123cb.tar.gz
Test abstracting over a type variable of kind Constraint
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_run/all.T1
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun046.hs17
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun046.stdout1
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T
index aeeacb64ff..aacdc7d082 100644
--- a/testsuite/tests/typecheck/should_run/all.T
+++ b/testsuite/tests/typecheck/should_run/all.T
@@ -68,6 +68,7 @@ test('tcrun042', normal, compile_and_run, [''])
test('tcrun043', normal, compile_and_run, [''])
test('tcrun044', normal, compile_and_run, [''])
test('tcrun045', normal, compile_and_run, [''])
+test('tcrun046', normal, compile_and_run, [''])
test('church', normal, compile_and_run, [''])
test('testeq2', normal, compile_and_run, [''])
diff --git a/testsuite/tests/typecheck/should_run/tcrun046.hs b/testsuite/tests/typecheck/should_run/tcrun046.hs
new file mode 100644
index 0000000000..9eb4018adb
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/tcrun046.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TypeFamilies, ConstraintKind, GADTs #-}
+
+module Main where
+
+-- Here we abstract over a *constraint*!
+-- T :: Constraint -> *
+
+data T a where
+ MkT :: a => T a
+
+f :: T (Ord x) -> x -> Bool
+f MkT x = x > x
+
+g :: T (Ord Int)
+g = MkT
+
+main = print (f g 4)
diff --git a/testsuite/tests/typecheck/should_run/tcrun046.stdout b/testsuite/tests/typecheck/should_run/tcrun046.stdout
new file mode 100644
index 0000000000..bc59c12aa1
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/tcrun046.stdout
@@ -0,0 +1 @@
+False