From 5f06cf6b6199c8f0e4921f4126f6eb15e2ff18ac Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Fri, 22 Jun 2018 21:32:19 +0200 Subject: TTG for IPBind had wrong extension name The standard[1] for extension naming is to use the XC prefix for the internal extension points, rather than for a new constructor. This is violated for IPBind, having data IPBind id = IPBind (XIPBind id) (Either (Located HsIPName) (IdP id)) (LHsExpr id) | XCIPBind (XXIPBind id) Swap the usage of XIPBind and XCIPBind [1] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow#Namingconventions Closes #15302 --- compiler/hsSyn/HsBinds.hs | 8 ++++---- compiler/hsSyn/HsExtension.hs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/hsSyn') diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs index e4a6906996..98f503b0d9 100644 --- a/compiler/hsSyn/HsBinds.hs +++ b/compiler/hsSyn/HsBinds.hs @@ -859,12 +859,12 @@ type LIPBind id = Located (IPBind id) -- For details on above see note [Api annotations] in ApiAnnotation data IPBind id = IPBind - (XIPBind id) + (XCIPBind id) (Either (Located HsIPName) (IdP id)) (LHsExpr id) - | XCIPBind (XXIPBind id) + | XIPBind (XXIPBind id) -type instance XIPBind (GhcPass p) = NoExt +type instance XCIPBind (GhcPass p) = NoExt type instance XXIPBind (GhcPass p) = NoExt instance (p ~ GhcPass pass, OutputableBndrId p) @@ -878,7 +878,7 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (IPBind p) where where name = case lr of Left (L _ ip) -> pprBndr LetBind ip Right id -> pprBndr LetBind id - ppr (XCIPBind x) = ppr x + ppr (XIPBind x) = ppr x {- ************************************************************************ diff --git a/compiler/hsSyn/HsExtension.hs b/compiler/hsSyn/HsExtension.hs index 52e19b96f3..a23b973b79 100644 --- a/compiler/hsSyn/HsExtension.hs +++ b/compiler/hsSyn/HsExtension.hs @@ -156,11 +156,11 @@ type ForallXHsIPBinds (c :: * -> Constraint) (x :: *) = ) -- IPBind type families -type family XIPBind x +type family XCIPBind x type family XXIPBind x type ForallXIPBind (c :: * -> Constraint) (x :: *) = - ( c (XIPBind x) + ( c (XCIPBind x) , c (XXIPBind x) ) -- cgit v1.2.1