summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Ext/Ast.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Iface/Ext/Ast.hs')
-rw-r--r--compiler/GHC/Iface/Ext/Ast.hs35
1 files changed, 19 insertions, 16 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs
index 893966d3eb..022cc6cb2b 100644
--- a/compiler/GHC/Iface/Ext/Ast.hs
+++ b/compiler/GHC/Iface/Ext/Ast.hs
@@ -643,16 +643,16 @@ instance HasType (LHsExpr GhcTc) where
-- See impact on Haddock output (esp. missing type annotations or links)
-- before marking more things here as 'False'. See impact on Haddock
-- performance before marking more things as 'True'.
- skipDesugaring :: HsExpr a -> Bool
+ skipDesugaring :: HsExpr GhcTc -> Bool
skipDesugaring e = case e of
- HsVar{} -> False
- HsUnboundVar{} -> False
- HsConLikeOut{} -> False
- HsRecFld{} -> False
- HsOverLabel{} -> False
- HsIPVar{} -> False
- HsWrap{} -> False
- _ -> True
+ HsVar{} -> False
+ HsUnboundVar{} -> False
+ HsConLikeOut{} -> False
+ HsRecFld{} -> False
+ HsOverLabel{} -> False
+ HsIPVar{} -> False
+ XExpr (HsWrap{}) -> False
+ _ -> True
instance ( ToHie (Context (Located (IdP a)))
, ToHie (MatchGroup a (LHsExpr a))
@@ -732,7 +732,7 @@ instance ( ToHie (MatchGroup a (LHsExpr a))
instance ( a ~ GhcPass p
, ToHie body
- , ToHie (HsMatchContext (NameOrRdrName (IdP a)))
+ , ToHie (HsMatchContext (NoGhcTc a))
, ToHie (PScoped (LPat a))
, ToHie (GRHSs a body)
, Data (Match a body)
@@ -746,7 +746,7 @@ instance ( a ~ GhcPass p
]
XMatch _ -> []
-instance ( ToHie (Context (Located a))
+instance ( ToHie (Context (Located (IdP a)))
) => ToHie (HsMatchContext a) where
toHie (FunRhs{mc_fun=name}) = toHie $ C MatchBind name
toHie (StmtCtxt a) = toHie a
@@ -885,6 +885,7 @@ instance ( a ~ GhcPass p
, Data (HsTupArg a)
, Data (AmbiguousFieldOcc a)
, (HasRealDataConName a)
+ , IsPass p
) => ToHie (LHsExpr (GhcPass p)) where
toHie e@(L mspan oexpr) = concatM $ getTypeNode e : case oexpr of
HsVar _ (L _ var) ->
@@ -997,9 +998,6 @@ instance ( a ~ GhcPass p
HsBinTick _ _ _ expr ->
[ toHie expr
]
- HsWrap _ _ a ->
- [ toHie $ L mspan a
- ]
HsBracket _ b ->
[ toHie b
]
@@ -1014,7 +1012,13 @@ instance ( a ~ GhcPass p
HsSpliceE _ x ->
[ toHie $ L mspan x
]
- XExpr _ -> []
+ XExpr x
+ | GhcTc <- ghcPass @p
+ , HsWrap _ a <- x
+ -> [ toHie $ L mspan a ]
+
+ | otherwise
+ -> []
instance ( a ~ GhcPass p
, ToHie (LHsExpr a)
@@ -1244,7 +1248,6 @@ instance ( a ~ GhcPass p
[ pure $ locOnly ispan
, toHie $ listScopes NoScope stmts
]
- HsCmdWrap _ _ _ -> []
XCmd _ -> []
instance ToHie (TyClGroup GhcRn) where