summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-06-28 17:43:24 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-29 15:36:08 -0400
commit4e9f58c759f16a3a20c338799a5b83d334c2778d (patch)
treef7013651d23a13356499ef2d22b54919f8faa6ca /compiler/GHC/Iface
parentb760c1f743ddb496886f095baa920740b38c9ce0 (diff)
downloadhaskell-4e9f58c759f16a3a20c338799a5b83d334c2778d.tar.gz
Use HsExpansion for overloaded list patterns
Fixes #14380, #19997
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r--compiler/GHC/Iface/Ext/Ast.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs
index f198dc55c1..f4cc42949a 100644
--- a/compiler/GHC/Iface/Ext/Ast.hs
+++ b/compiler/GHC/Iface/Ext/Ast.hs
@@ -1020,14 +1020,14 @@ instance HiePass p => ToHie (PScoped (LocatedA (Pat (GhcPass p)))) where
]
XPat e ->
case hiePass @p of
- HieTc ->
- let CoPat wrap pat _ = e
- in [ toHie $ L ospan wrap
- , toHie $ PS rsp scope pscope $ (L ospan pat)
- ]
-#if __GLASGOW_HASKELL__ < 811
- HieRn -> []
-#endif
+ HieRn -> case e of
+ HsPatExpanded _ p -> [ toHie $ PS rsp scope pscope (L ospan p) ]
+ HieTc -> case e of
+ CoPat wrap pat _ ->
+ [ toHie $ L ospan wrap
+ , toHie $ PS rsp scope pscope $ (L ospan pat)
+ ]
+ ExpansionPat _ p -> [ toHie $ PS rsp scope pscope (L ospan p) ]
where
contextify :: a ~ LPat (GhcPass p) => HsConDetails (HsPatSigType (NoGhcTc (GhcPass p))) a (HsRecFields (GhcPass p) a)
-> HsConDetails (TScoped (HsPatSigType (NoGhcTc (GhcPass p)))) (PScoped a) (RContext (HsRecFields (GhcPass p) (PScoped a)))