[commit: ghc] master: Test Trac #14488 (0db4627)
git at git.haskell.org
git at git.haskell.org
Wed Nov 22 02:11:47 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0db4627b8baf3255cf16725f8acdd69e27f0ab85/ghc
>---------------------------------------------------------------
commit 0db4627b8baf3255cf16725f8acdd69e27f0ab85
Author: Vladislav Zavialov <vlad.z.4096 at gmail.com>
Date: Tue Nov 21 18:28:21 2017 -0500
Test Trac #14488
Summary:
The refactoring in 3f5673f34a2f761423027bf46f64f7499708725f also fixed a
previously unreported issue in the typechecker that prevented defining a
lens to a record field with a constraint. This patch adds a regression
test.
Test Plan: make test TEST=14488
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: int-e, rwbarton, thomie
GHC Trac Issues: #14488
Differential Revision: https://phabricator.haskell.org/D4213
>---------------------------------------------------------------
0db4627b8baf3255cf16725f8acdd69e27f0ab85
testsuite/tests/typecheck/should_compile/T14488.hs | 10 ++++++++++
testsuite/tests/typecheck/should_compile/all.T | 1 +
2 files changed, 11 insertions(+)
diff --git a/testsuite/tests/typecheck/should_compile/T14488.hs b/testsuite/tests/typecheck/should_compile/T14488.hs
new file mode 100644
index 0000000..a4a1284
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T14488.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE RankNTypes #-}
+
+module T14488 where
+
+type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s
+
+data T a = MkT { _tfield :: Eq a => a }
+
+tfield :: Eq a => Lens' (T a) a
+tfield f t = MkT <$> f (_tfield t)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 417e43e..19a99db 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -584,3 +584,4 @@ test('T7169', normal, compile, [''])
test('T14434', [], run_command, ['$MAKE -s --no-print-directory T14434'])
test('MissingExportList01', normal, compile, [''])
test('MissingExportList02', normal, compile, [''])
+test('T14488', normal, compile, [''])
More information about the ghc-commits
mailing list