diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-09-21 15:51:52 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-09-21 15:51:52 +0100 |
commit | eb51b56e56df684ea3f0b8d8ddb55f9fa4ece329 (patch) | |
tree | eea5817396f934f2e82e915b28ca4d52463ceb72 | |
parent | c30773ce53714980594a5fa2b8a0e6f5547b3c4d (diff) | |
download | haskell-eb51b56e56df684ea3f0b8d8ddb55f9fa4ece329.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.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 2 |
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, ['']) |