summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsImpExp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/hsSyn/HsImpExp.hs')
-rw-r--r--compiler/hsSyn/HsImpExp.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/hsSyn/HsImpExp.hs b/compiler/hsSyn/HsImpExp.hs
index d97be4bd54..e2cf5254b5 100644
--- a/compiler/hsSyn/HsImpExp.hs
+++ b/compiler/hsSyn/HsImpExp.hs
@@ -85,7 +85,7 @@ data ImportDecl pass
-- For details on above see note [Api annotations] in ApiAnnotation
type instance XCImportDecl (GhcPass _) = NoExt
-type instance XXImportDecl (GhcPass _) = NoExt
+type instance XXImportDecl (GhcPass _) = NoExtCon
simpleImportDecl :: ModuleName -> ImportDecl (GhcPass p)
simpleImportDecl mn = ImportDecl {
@@ -235,7 +235,7 @@ type instance XIEModuleContents (GhcPass _) = NoExt
type instance XIEGroup (GhcPass _) = NoExt
type instance XIEDoc (GhcPass _) = NoExt
type instance XIEDocNamed (GhcPass _) = NoExt
-type instance XXIE (GhcPass _) = NoExt
+type instance XXIE (GhcPass _) = NoExtCon
-- | Imported or Exported Wildcard
data IEWildcard = NoIEWildcard | IEWildcard Int deriving (Eq, Data)
@@ -257,14 +257,14 @@ gives rise to
See Note [Representing fields in AvailInfo] in Avail for more details.
-}
-ieName :: IE pass -> IdP pass
+ieName :: (XXIE pass ~ NoExtCon) => IE pass -> IdP pass
ieName (IEVar _ (L _ n)) = ieWrappedName n
ieName (IEThingAbs _ (L _ n)) = ieWrappedName n
ieName (IEThingWith _ (L _ n) _ _ _) = ieWrappedName n
ieName (IEThingAll _ (L _ n)) = ieWrappedName n
ieName _ = panic "ieName failed pattern match!"
-ieNames :: IE pass -> [IdP pass]
+ieNames :: (XXIE pass ~ NoExtCon) => IE pass -> [IdP pass]
ieNames (IEVar _ (L _ n) ) = [ieWrappedName n]
ieNames (IEThingAbs _ (L _ n) ) = [ieWrappedName n]
ieNames (IEThingAll _ (L _ n) ) = [ieWrappedName n]
@@ -274,7 +274,7 @@ ieNames (IEModuleContents {}) = []
ieNames (IEGroup {}) = []
ieNames (IEDoc {}) = []
ieNames (IEDocNamed {}) = []
-ieNames (XIE {}) = panic "ieNames"
+ieNames (XIE nec) = noExtCon nec
ieWrappedName :: IEWrappedName name -> name
ieWrappedName (IEName (L _ n)) = n