Commit 3cfe60ae authored by Jan Stolarek's avatar Jan Stolarek

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
parent f4056324
......@@ -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
......
......@@ -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 ..
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment