[Git][ghc/ghc][wip/jade/ast] fixed note pointer, unneeded imports, and unmatched datacon.

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Tue Oct 1 15:36:20 UTC 2024



Hassan Al-Awwadi pushed to branch wip/jade/ast at Glasgow Haskell Compiler / GHC


Commits:
142c8c94 by Hassan Al-Awwadi at 2024-10-01T17:36:01+02:00
fixed note pointer, unneeded imports, and unmatched datacon.

the datacon is actually impossible but whatever. GHC wants what it wants.

- - - - -


2 changed files:

- compiler/Language/Haskell/Syntax/Type.hs
- utils/check-exact/ExactPrint.hs


Changes:

=====================================
compiler/Language/Haskell/Syntax/Type.hs
=====================================
@@ -1360,6 +1360,7 @@ type LUpdFieldOcc pass = XRec pass (UpdFieldOcc pass)
 --
 -- We differentiate between the two since there may be additional information concerning the update field.
 -- In particular, in GHC, an update field occurrence *may* be ambiguous, unlike other field occurrences.
+-- See Note [Lifecycle of an UpdFieldOcc]
 data UpdFieldOcc pass
   = UpdFieldOcc {
     ufoExt   :: XCUpdFieldOcc pass,
@@ -1380,8 +1381,6 @@ type LFieldOcc pass = XRec pass (FieldOcc pass)
 -- We store both the 'RdrName' the user originally wrote, and after
 -- the renamer we use the extension field to store the selector
 -- function.
---
--- See Note [Lifecycle of a FieldOcc]
 data FieldOcc pass
   = FieldOcc {
         foExt :: XCFieldOcc pass


=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -53,7 +53,6 @@ import GHC.Utils.Outputable hiding ( (<>) )
 import GHC.Utils.Panic
 
 import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-import Language.Haskell.Syntax.Type (UpdFieldOcc(..), FieldOcc(..))
 
 import Control.Monad (forM, when, unless)
 import Control.Monad.Identity (Identity(..))
@@ -4595,8 +4594,8 @@ instance ExactPrint (FieldOcc GhcPs) where
 instance ExactPrint (UpdFieldOcc GhcPs) where
   getAnnotationEntry = const NoEntryVal
   setAnnotationAnchor a _ _ _ = a
-  exact f@(UpdFieldOcc _ n) = markAnnotated n >> return f
-
+  exact f@(UpdFieldOcc _ n)         = markAnnotated n >> return f
+  exact f@(XUpdFieldOcc impossible) = dataConCantHappen impossible
 -- ---------------------------------------------------------------------
 
 instance (ExactPrint a) => ExactPrint (HsScaled GhcPs a) where



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/142c8c9407666563f637c147bf24249bff235422

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/142c8c9407666563f637c147bf24249bff235422
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241001/bdbe6aa7/attachment-0001.html>


More information about the ghc-commits mailing list