[commit: ghc] master: Abstract TFs can have injectivity information (3cfe60a)
git at git.haskell.org
git at git.haskell.org
Tue Nov 10 06:39:01 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3cfe60aebb9de2a1d897a111f779eacb6614b7cc/ghc
>---------------------------------------------------------------
commit 3cfe60aebb9de2a1d897a111f779eacb6614b7cc
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date: Mon Nov 9 15:44:47 2015 +0100
Abstract TFs can have injectivity information
Summary:
For abstract type families we incorrectly rejected their injectivity
annotation. Fixes #11007.
Test Plan: #6018
Reviewers: goldfire, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1453
GHC Trac Issues: #11007
>---------------------------------------------------------------
3cfe60aebb9de2a1d897a111f779eacb6614b7cc
compiler/typecheck/TcTyClsDecls.hs | 7 +++----
testsuite/tests/typecheck/should_compile/T6018.hs-boot | 7 +++++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index d1a6c76..c21baf0 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -699,10 +699,9 @@ tcFamDecl1 parent
-- If Nothing, this is an abstract family in a hs-boot file;
-- but eqns might be empty in the Just case as well
; case mb_eqns of
- Nothing ->
- return [ATyCon $ buildFamilyTyCon tc_name tvs' Nothing
- AbstractClosedSynFamilyTyCon kind parent
- NotInjective ]
+ Nothing -> return
+ [ ATyCon $ buildFamilyTyCon tc_name tvs' (resultVariableName sig)
+ AbstractClosedSynFamilyTyCon kind parent inj' ]
Just eqns -> do {
-- Process the equations, creating CoAxBranches
diff --git a/testsuite/tests/typecheck/should_compile/T6018.hs-boot b/testsuite/tests/typecheck/should_compile/T6018.hs-boot
index 8ac5ce9..e31903a 100644
--- a/testsuite/tests/typecheck/should_compile/T6018.hs-boot
+++ b/testsuite/tests/typecheck/should_compile/T6018.hs-boot
@@ -2,6 +2,9 @@
module T6018 where
--- this declaration uses different type variables than the one in the source
--- file but it should be accepted nevertheless
+-- these declarations use different type variables than the ones in the source
+-- file but they should be accepted nevertheless
+
type family F d e f = (r :: k) | r -> d e f
+
+type family FClosed (d :: *) (e :: *) (f :: *) = (r :: *) | r -> d e f where ..
More information about the ghc-commits
mailing list