summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T4404.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T4404.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T4404.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T4404.hs b/testsuite/tests/typecheck/should_compile/T4404.hs
new file mode 100644
index 0000000000..894066542a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T4404.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE RecordWildCards, DoRec #-}
+
+module TT where
+
+data T = T {t1, t2 :: Int}
+
+f :: T -> Int
+f d = x
+ where T {t1 = x, ..} = d
+
+g :: T -> Int
+g (T {t1 = x, ..}) = x
+
+-- The fix to this test also affected the dorec checking code, hence this:
+h :: Maybe Int
+h = do
+ rec
+ T {t1 = x, ..} <- Just $ T 1 1
+ return x