[commit: ghc] wip/spj-tc-branch: Test Trac #12507 (eb51b56)

git at git.haskell.org git at git.haskell.org
Wed Sep 21 14:54:12 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/spj-tc-branch
Link       : http://ghc.haskell.org/trac/ghc/changeset/eb51b56e56df684ea3f0b8d8ddb55f9fa4ece329/ghc

>---------------------------------------------------------------

commit eb51b56e56df684ea3f0b8d8ddb55f9fa4ece329
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Sep 21 15:51:52 2016 +0100

    Test Trac #12507
    
    This is now working apparently.  It relates to when a
    polymorphic function gets instantiated, under some
    implicit paramter bindings.


>---------------------------------------------------------------

eb51b56e56df684ea3f0b8d8ddb55f9fa4ece329
 testsuite/tests/typecheck/should_compile/T12507.hs | 16 ++++++++++++++++
 testsuite/tests/typecheck/should_compile/all.T     |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/testsuite/tests/typecheck/should_compile/T12507.hs b/testsuite/tests/typecheck/should_compile/T12507.hs
new file mode 100644
index 0000000..b4cfd0e
--- /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 9f32b44..72c8ce9 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, [''])



More information about the ghc-commits mailing list