diff options
author | romes <rodrigo.m.mesquita@gmail.com> | 2022-03-10 20:02:36 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-18 05:10:58 -0400 |
commit | 310890a51372937afa69e1edac1179eba67ac046 (patch) | |
tree | a69e155c1f7bf29d3a2a4c5d2f0c394e1dfdf06f /compiler/GHC/Iface/Ext/Ast.hs | |
parent | 19163397000ae3ce9886a75bef900d35774d864e (diff) | |
download | haskell-310890a51372937afa69e1edac1179eba67ac046.tar.gz |
Separate constructors for typed and untyped brackets
Split HsBracket into HsTypedBracket and HsUntypedBracket.
Unfortunately, we still cannot get rid of
instance XXTypedBracket GhcTc = HsTypedBracket GhcRn
despite no longer requiring it for typechecking, but rather because the
TH desugarer works on GhcRn rather than GhcTc (See GHC.HsToCore.Quote)
Diffstat (limited to 'compiler/GHC/Iface/Ext/Ast.hs')
-rw-r--r-- | compiler/GHC/Iface/Ext/Ast.hs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index 3aba40407b..c825c46a01 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/compiler/GHC/Iface/Ext/Ast.hs @@ -1183,12 +1183,16 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where HsStatic _ expr -> [ toHie expr ] - HsBracket xbracket b -> case hiePass @p of - HieRn -> case xbracket of - HsBracketRnTyped _ -> + HsTypedBracket xbracket b -> case hiePass @p of + HieRn | _ <- xbracket -> [ toHie b ] - HsBracketRnUntyped _ p -> + HieTc | HsBracketTc _ _ p <- xbracket -> + [ toHie b + , toHie p + ] + HsUntypedBracket xbracket b -> case hiePass @p of + HieRn | (_, p) <- xbracket -> [ toHie b , toHie p ] @@ -1855,7 +1859,10 @@ instance ToHie (LocatedA (SpliceDecl GhcRn)) where [ toHie splice ] -instance ToHie (HsBracket a) where +instance ToHie (HsTypedBracket a) where + toHie _ = pure [] + +instance ToHie (HsUntypedBracket a) where toHie _ = pure [] instance ToHie PendingRnSplice where |