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-30 12:57:06 +0100
commit0b06fcc23bd029c00884bbdb92ffd3a7e1c95c88 (patch)
tree5130a6aefa8c71d0eace0881278f2948636dedcd
parentff8b588e81abe015bf23f1b75f9e8d5705b108c3 (diff)
downloadhaskell-0b06fcc23bd029c00884bbdb92ffd3a7e1c95c88.tar.gz
Test Trac #12507
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.T1
2 files changed, 17 insertions, 0 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 4ca8c91fc5..6dc3a73219 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -544,3 +544,4 @@ test('T12466a', normal, compile, [''])
test('T12644', normal, compile, [''])
test('T12427a', normal, compile_fail, [''])
test('T12427b', normal, compile, [''])
+test('T12507', normal, compile, [''])