summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2017-11-21 18:28:21 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-21 21:11:16 -0500
commit0db4627b8baf3255cf16725f8acdd69e27f0ab85 (patch)
treeb2c2742ca62004001e74866a0897d03a4e8a2227 /testsuite
parentdad9864211a87bb23ae6efe0a2dd56f0eaa85601 (diff)
downloadhaskell-0db4627b8baf3255cf16725f8acdd69e27f0ab85.tar.gz
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
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T14488.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T14488.hs b/testsuite/tests/typecheck/should_compile/T14488.hs
new file mode 100644
index 0000000000..a4a12841b7
--- /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 417e43ee70..19a99db629 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, [''])