summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-09-21 15:51:52 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-09-21 15:51:52 +0100
commiteb51b56e56df684ea3f0b8d8ddb55f9fa4ece329 (patch)
treeeea5817396f934f2e82e915b28ca4d52463ceb72
parentc30773ce53714980594a5fa2b8a0e6f5547b3c4d (diff)
downloadhaskell-wip/spj-tc-branch.tar.gz
Test Trac #12507wip/spj-tc-branch
This is now working apparently. It relates to when a polymorphic function gets instantiated, under some implicit paramter bindings.
-rw-r--r--testsuite/tests/typecheck/should_compile/T12507.hs16
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
2 files changed, 17 insertions, 1 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T12507.hs b/testsuite/tests/typecheck/should_compile/T12507.hs
new file mode 100644
index 0000000000..b4cfd0e082
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12507.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE GADTs, ConstraintKinds, Rank2Types, ImplicitParams #-}
+
+module T12507 where
+
+data Rec fields where
+ Rec :: fields => Rec fields
+
+qn :: Rec fields -> (fields => r) -> r
+qn Rec e = e
+
+record :: Rec (?a :: Int, ?b :: String)
+record = Rec where ?a=42
+ ?b="hey"
+
+access :: Int
+access = qn record ?a
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 9f32b44d31..72c8ce93fa 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -535,4 +535,4 @@ test('T12381', normal, compile, [''])
test('T12082', normal, compile, [''])
test('T12427a', normal, compile_fail, [''])
test('T12427b', normal, compile, [''])
-
+test('T12507', normal, compile, [''])