summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T11524.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-02-02 05:02:23 -0800
committerBartosz Nitka <niteria@gmail.com>2016-02-02 05:04:04 -0800
commit07ed24132ebe62aab15f14a655506decdf252ff9 (patch)
tree07e67f35a1556e3877682abd6e98eff9e7ce73a4 /testsuite/tests/typecheck/should_compile/T11524.hs
parent01c587c03764de52cd01a3464c1a4a5c5bce7c00 (diff)
downloadhaskell-07ed24132ebe62aab15f14a655506decdf252ff9.tar.gz
Use a correct substitution in tcCheckPatSynDecl
The `substTheta` call didn't have the free variables of the `prov_theta` in the `in_scope` set. It should be enough to add `univ_tvs`, as all the `ex_tvs` are already in the domain of the substitution. Test Plan: added a testcase Reviewers: simonpj, bgamari, goldfire, austin Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1879 GHC Trac Issues: #11524
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T11524.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T11524.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T11524.hs b/testsuite/tests/typecheck/should_compile/T11524.hs
new file mode 100644
index 0000000000..d257554439
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T11524.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ExplicitForAll #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE TypeInType #-}
+
+module T11524 where
+
+data AType (a :: k) where
+ AMaybe :: AType Maybe
+ AInt :: AType Int
+ AApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
+ AType a -> AType b -> AType (a b)
+
+pattern PApp :: () => (fun ~ a b) => AType a -> AType b -> AType fun
+--pattern PApp :: forall k (fun :: k) k1 (a :: k1 -> k) (b :: k1).
+-- () => (fun ~ a b) => AType a -> AType b -> AType fun
+pattern PApp fun arg <- AApp fun arg