[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Use correct FunTyFlag in adjustJoinPointType

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Sep 18 01:30:20 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
8e05c54a by Simon Peyton Jones at 2023-09-16T01:42:33-04:00
Use correct FunTyFlag in adjustJoinPointType

As the Lint error in #23952 showed, the function adjustJoinPointType
was failing to adjust the FunTyFlag when adjusting the type.

I don't think this caused the seg-fault reported in the ticket,
but it is definitely.  This patch fixes it.

It is tricky to come up a small test case; Krzysztof came up with
this one, but it only triggers a failure in GHC 9.6.

- - - - -
778c84b6 by Pierre Le Marre at 2023-09-16T01:43:15-04:00
Update to Unicode 15.1.0

See: https://www.unicode.org/versions/Unicode15.1.0/

- - - - -
c52dc773 by Alan Zimmerman at 2023-09-17T21:30:03-04:00
EPA: track unicode version for unrestrictedFunTyCon

Closes #23885

Updates haddock submodule

- - - - -
7ab18125 by Bodigrim at 2023-09-17T21:30:08-04:00
Bump parsec submodule to allow text-2.1 and bytestring-0.12

- - - - -


25 changed files:

- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Types/Var.hs
- docs/users_guide/9.10.1-notes.rst
- libraries/base/GHC/Unicode/Internal/Char/DerivedCoreProperties.hs
- libraries/base/GHC/Unicode/Internal/Char/UnicodeData/GeneralCategory.hs
- libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleLowerCaseMapping.hs
- libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleTitleCaseMapping.hs
- libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleUpperCaseMapping.hs
- libraries/base/GHC/Unicode/Internal/Version.hs
- libraries/base/changelog.md
- libraries/base/tests/unicode003.stdout
- libraries/base/tools/ucd2haskell/ucd.sh
- libraries/base/tools/ucd2haskell/unicode_version
- libraries/parsec
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/Test23885.hs
- testsuite/tests/printer/all.T
- + testsuite/tests/simplCore/should_compile/T23952.hs
- + testsuite/tests/simplCore/should_compile/T23952a.hs
- testsuite/tests/simplCore/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/haddock


Changes:

=====================================
compiler/GHC/Core/Opt/Simplify/Env.hs
=====================================
@@ -58,29 +58,33 @@ import GHC.Core.Opt.Simplify.Monad
 import GHC.Core.Rules.Config ( RuleOpts(..) )
 import GHC.Core
 import GHC.Core.Utils
-import GHC.Core.Multiplicity     ( scaleScaled )
 import GHC.Core.Unfold
 import GHC.Core.TyCo.Subst (emptyIdSubstEnv)
+import GHC.Core.Multiplicity( Scaled(..), mkMultMul )
+import GHC.Core.Make            ( mkWildValBinder, mkCoreLet )
+import GHC.Core.Type hiding     ( substTy, substTyVar, substTyVarBndr, substCo
+                                , extendTvSubst, extendCvSubst )
+import qualified GHC.Core.Coercion as Coercion
+import GHC.Core.Coercion hiding ( substCo, substCoVar, substCoVarBndr )
+import qualified GHC.Core.Type as Type
+
 import GHC.Types.Var
 import GHC.Types.Var.Env
 import GHC.Types.Var.Set
+import GHC.Types.Id as Id
+import GHC.Types.Basic
+import GHC.Types.Unique.FM      ( pprUniqFM )
+
 import GHC.Data.OrdList
 import GHC.Data.Graph.UnVar
-import GHC.Types.Id as Id
-import GHC.Core.Make            ( mkWildValBinder, mkCoreLet )
+
 import GHC.Builtin.Types
-import qualified GHC.Core.Type as Type
-import GHC.Core.Type hiding     ( substTy, substTyVar, substTyVarBndr, substCo
-                                , extendTvSubst, extendCvSubst )
-import qualified GHC.Core.Coercion as Coercion
-import GHC.Core.Coercion hiding ( substCo, substCoVar, substCoVarBndr )
 import GHC.Platform ( Platform )
-import GHC.Types.Basic
+
 import GHC.Utils.Monad
 import GHC.Utils.Outputable
 import GHC.Utils.Panic
 import GHC.Utils.Misc
-import GHC.Types.Unique.FM      ( pprUniqFM )
 
 import Data.List ( intersperse, mapAccumL )
 
@@ -1170,21 +1174,34 @@ adjustJoinPointType mult new_res_ty join_id
   = assert (isJoinId join_id) $
     setIdType join_id new_join_ty
   where
-    orig_ar = idJoinArity join_id
-    orig_ty = idType join_id
-
-    new_join_ty = go orig_ar orig_ty :: Type
+    join_arity = idJoinArity join_id
+    orig_ty    = idType join_id
+    res_torc   = typeTypeOrConstraint new_res_ty :: TypeOrConstraint
+
+    new_join_ty = go join_arity orig_ty :: Type
+
+    go :: JoinArity -> Type -> Type
+    go n ty
+      | n == 0
+      = new_res_ty
+
+      | Just (arg_bndr, body_ty) <- splitPiTy_maybe ty
+      , let body_ty' = go (n-1) body_ty
+      = case arg_bndr of
+          Named b                          -> mkForAllTy b body_ty'
+          Anon (Scaled arg_mult arg_ty) af -> mkFunTy af' arg_mult' arg_ty body_ty'
+              where
+                -- Using "!": See Note [Bangs in the Simplifier]
+                -- mkMultMul: see Note [Scaling join point arguments]
+                !arg_mult' = arg_mult `mkMultMul` mult
+
+                -- the new_res_ty might be ConstraintLike while the original
+                -- one was TypeLike.  So we may need to adjust the FunTyFlag.
+                -- (see #23952)
+                !af' = mkFunTyFlag (funTyFlagArgTypeOrConstraint af) res_torc
 
-    go 0 _  = new_res_ty
-    go n ty | Just (arg_bndr, res_ty) <- splitPiTy_maybe ty
-            = mkPiTy (scale_bndr arg_bndr) $
-              go (n-1) res_ty
-            | otherwise
-            = pprPanic "adjustJoinPointType" (ppr orig_ar <+> ppr orig_ty)
-
-    -- See Note [Bangs in the Simplifier]
-    scale_bndr (Anon t af) = (Anon $! (scaleScaled mult t)) af
-    scale_bndr b@(Named _) = b
+      | otherwise
+      = pprPanic "adjustJoinPointType" (ppr join_arity <+> ppr orig_ty)
 
 {- Note [Scaling join point arguments]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


=====================================
compiler/GHC/Core/Type.hs
=====================================
@@ -2567,12 +2567,12 @@ Here are the key kinding rules for types
           -- in GHC.Builtin.Types.Prim
 
           torc is TYPE or CONSTRAINT
-          ty : torc rep
+          ty : body_torc rep
           ki : Type
           `a` is a type variable
           `a` is not free in rep
 (FORALL1) -----------------------
-          forall (a::ki). ty : torc rep
+          forall (a::ki). ty : body_torc rep
 
           torc is TYPE or CONSTRAINT
           ty : body_torc rep


=====================================
compiler/GHC/Parser.y
=====================================
@@ -773,9 +773,9 @@ identifier :: { LocatedN RdrName }
         | qvarop                        { $1 }
         | qconop                        { $1 }
     | '(' '->' ')'      {% amsrn (sLL $1 $> $ getRdrName unrestrictedFunTyCon)
-                                 (NameAnn NameParens (glAA $1) (glAA $2) (glAA $3) []) }
+                                 (NameAnnRArrow (isUnicode $2) (Just $ glAA $1) (glAA $2) (Just $ glAA $3) []) }
     | '->'              {% amsrn (sLL $1 $> $ getRdrName unrestrictedFunTyCon)
-                                 (NameAnnRArrow (glAA $1) []) }
+                                 (NameAnnRArrow (isUnicode $1) Nothing (glAA $1) Nothing []) }
 
 -----------------------------------------------------------------------------
 -- Backpack stuff
@@ -3662,7 +3662,7 @@ ntgtycon :: { LocatedN RdrName }  -- A "general" qualified tycon, excluding unit
         | '(#' bars '#)'        {% amsrn (sLL $1 $> $ getRdrName (sumTyCon (snd $2 + 1)))
                                        (NameAnnBars NameParensHash (glAA $1) (map srcSpan2e (fst $2)) (glAA $3) []) }
         | '(' '->' ')'          {% amsrn (sLL $1 $> $ getRdrName unrestrictedFunTyCon)
-                                       (NameAnn NameParens (glAA $1) (glAA $2) (glAA $3) []) }
+                                       (NameAnnRArrow (isUnicode $2) (Just $ glAA $1) (glAA $2) (Just $ glAA $3) []) }
         | '[' ']'               {% amsrn (sLL $1 $> $ listTyCon_RDR)
                                        (NameAnnOnly NameSquare (glAA $1) (glAA $2) []) }
 
@@ -3744,7 +3744,8 @@ otycon :: { LocatedN RdrName }
 op      :: { LocatedN RdrName }   -- used in infix decls
         : varop                 { $1 }
         | conop                 { $1 }
-        | '->'                  { sL1n $1 $ getRdrName unrestrictedFunTyCon }
+        | '->'                  {% amsrn (sLL $1 $> $ getRdrName unrestrictedFunTyCon)
+                                     (NameAnnRArrow (isUnicode $1) Nothing (glAA $1) Nothing []) }
 
 varop   :: { LocatedN RdrName }
         : varsym                { $1 }


=====================================
compiler/GHC/Parser/Annotation.hs
=====================================
@@ -759,7 +759,10 @@ data NameAnn
       }
   -- | Used for @->@, as an identifier
   | NameAnnRArrow {
+      nann_unicode   :: Bool,
+      nann_mopen     :: Maybe EpaLocation,
       nann_name      :: EpaLocation,
+      nann_mclose    :: Maybe EpaLocation,
       nann_trailing  :: [TrailingAnn]
       }
   -- | Used for an item with a leading @'@. The annotation for
@@ -1436,8 +1439,8 @@ instance Outputable NameAnn where
     = text "NameAnnBars" <+> ppr a <+> ppr o <+> ppr n <+> ppr b <+> ppr t
   ppr (NameAnnOnly a o c t)
     = text "NameAnnOnly" <+> ppr a <+> ppr o <+> ppr c <+> ppr t
-  ppr (NameAnnRArrow n t)
-    = text "NameAnnRArrow" <+> ppr n <+> ppr t
+  ppr (NameAnnRArrow u o n c t)
+    = text "NameAnnRArrow" <+> ppr u <+> ppr o <+> ppr n <+> ppr c <+> ppr t
   ppr (NameAnnQuote q n t)
     = text "NameAnnQuote" <+> ppr q <+> ppr n <+> ppr t
   ppr (NameAnnTrailing t)


=====================================
compiler/GHC/Types/Var.hs
=====================================
@@ -76,7 +76,7 @@ module GHC.Types.Var (
         mkFunTyFlag, visArg, invisArg,
         visArgTypeLike, visArgConstraintLike,
         invisArgTypeLike, invisArgConstraintLike,
-        funTyFlagResultTypeOrConstraint,
+        funTyFlagArgTypeOrConstraint, funTyFlagResultTypeOrConstraint,
         TypeOrConstraint(..),  -- Re-export this: it's an argument of FunTyFlag
 
         -- * PiTyBinder
@@ -609,6 +609,12 @@ isFUNArg :: FunTyFlag -> Bool
 isFUNArg FTF_T_T = True
 isFUNArg _       = False
 
+funTyFlagArgTypeOrConstraint :: FunTyFlag -> TypeOrConstraint
+-- Whether it /takes/ a type or a constraint
+funTyFlagArgTypeOrConstraint FTF_T_T = TypeLike
+funTyFlagArgTypeOrConstraint FTF_T_C = TypeLike
+funTyFlagArgTypeOrConstraint _       = ConstraintLike
+
 funTyFlagResultTypeOrConstraint :: FunTyFlag -> TypeOrConstraint
 -- Whether it /returns/ a type or a constraint
 funTyFlagResultTypeOrConstraint FTF_T_T = TypeLike


=====================================
docs/users_guide/9.10.1-notes.rst
=====================================
@@ -68,6 +68,8 @@ Runtime system
 ``base`` library
 ~~~~~~~~~~~~~~~~
 
+- Updated to `Unicode 15.1.0 <https://www.unicode.org/versions/Unicode15.1.0/>`_.
+
 ``ghc-prim`` library
 ~~~~~~~~~~~~~~~~~~~~
 


=====================================
libraries/base/GHC/Unicode/Internal/Char/DerivedCoreProperties.hs
=====================================
@@ -1,5 +1,5 @@
 -- DO NOT EDIT: This file is automatically generated by the internal tool ucd2haskell,
--- with data from: https://www.unicode.org/Public/15.0.0/ucd/DerivedCoreProperties.txt.
+-- with data from: https://www.unicode.org/Public/15.1.0/ucd/DerivedCoreProperties.txt.
 
 {-# LANGUAGE NoImplicitPrelude #-}
 {-# LANGUAGE MagicHash #-}


=====================================
libraries/base/GHC/Unicode/Internal/Char/UnicodeData/GeneralCategory.hs
=====================================
The diff for this file was not included because it is too large.

=====================================
libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleLowerCaseMapping.hs
=====================================
@@ -1,5 +1,5 @@
 -- DO NOT EDIT: This file is automatically generated by the internal tool ucd2haskell,
--- with data from: https://www.unicode.org/Public/15.0.0/ucd/UnicodeData.txt.
+-- with data from: https://www.unicode.org/Public/15.1.0/ucd/UnicodeData.txt.
 
 {-# LANGUAGE NoImplicitPrelude, LambdaCase #-}
 {-# OPTIONS_HADDOCK hide #-}


=====================================
libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleTitleCaseMapping.hs
=====================================
@@ -1,5 +1,5 @@
 -- DO NOT EDIT: This file is automatically generated by the internal tool ucd2haskell,
--- with data from: https://www.unicode.org/Public/15.0.0/ucd/UnicodeData.txt.
+-- with data from: https://www.unicode.org/Public/15.1.0/ucd/UnicodeData.txt.
 
 {-# LANGUAGE NoImplicitPrelude, LambdaCase #-}
 {-# OPTIONS_HADDOCK hide #-}


=====================================
libraries/base/GHC/Unicode/Internal/Char/UnicodeData/SimpleUpperCaseMapping.hs
=====================================
@@ -1,5 +1,5 @@
 -- DO NOT EDIT: This file is automatically generated by the internal tool ucd2haskell,
--- with data from: https://www.unicode.org/Public/15.0.0/ucd/UnicodeData.txt.
+-- with data from: https://www.unicode.org/Public/15.1.0/ucd/UnicodeData.txt.
 
 {-# LANGUAGE NoImplicitPrelude, LambdaCase #-}
 {-# OPTIONS_HADDOCK hide #-}


=====================================
libraries/base/GHC/Unicode/Internal/Version.hs
=====================================
@@ -19,8 +19,8 @@ where
 import {-# SOURCE #-} Data.Version
 
 -- | Version of Unicode standard used by @base@:
--- [15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
+-- [15.1.0](https://www.unicode.org/versions/Unicode15.1.0/).
 --
 -- @since 4.15.0.0
 unicodeVersion :: Version
-unicodeVersion = makeVersion [15, 0, 0]
+unicodeVersion = makeVersion [15, 1, 0]


=====================================
libraries/base/changelog.md
=====================================
@@ -5,6 +5,7 @@
   * Add a `RULE` to `Prelude.lookup`, allowing it to participate in list fusion ([CLC proposal #174](https://github.com/haskell/core-libraries-committee/issues/175))
   * The `Enum Int64` and `Enum Word64` instances now use native operations on 32-bit platforms, increasing performance by up to 1.5x on i386 and up to 5.6x with the JavaScript backend. ([CLC proposal #187](https://github.com/haskell/core-libraries-committee/issues/187))
   * Add rewrite rules for conversion between Int64/Word64 and Float/Double on 64-bit architectures ([CLC proposal #203](https://github.com/haskell/core-libraries-committee/issues/203)).
+  * Update to [Unicode 15.1.0](https://www.unicode.org/versions/Unicode15.1.0/).
 
 ## 4.19.0.0 *TBA*
   * Add `{-# WARNING in "x-partial" #-}` to `Data.List.{head,tail}`.


=====================================
libraries/base/tests/unicode003.stdout
=====================================
@@ -121,12 +121,12 @@ fa0,299354809,273668620
 2e7c,-303407671,86127504
 2ee0,962838393,-1874288820
 2f44,-1105473175,13438952
-2fa8,71804041,-1302289916
+2fa8,47615401,-1302289916
 300c,-617598666,1792393120
 3070,-284421394,-1091054596
 30d4,-1569867234,-249848968
 3138,-1522355883,1427914804
-319c,1411913369,-446832016
+319c,-1320418159,-446832016
 3200,-2097029110,-1317869076
 3264,7156258,-2084614840
 32c8,-1105473175,1921081060
@@ -1913,13 +1913,13 @@ ffdc,-2015459986,1906523440
 2ea7c,657752308,1252972432
 2eae0,657752308,-1692480692
 2eb44,657752308,1525062632
-2eba8,-13042365,-1770478076
-2ec0c,-847508383,1811413920
-2ec70,-847508383,-251803652
-2ecd4,-847508383,1750663032
-2ed38,-847508383,874626100
-2ed9c,-847508383,-1363708304
-2ee00,-847508383,835415532
+2eba8,-2011303353,-1770478076
+2ec0c,657752308,1811413920
+2ec70,657752308,-251803652
+2ecd4,657752308,1750663032
+2ed38,657752308,874626100
+2ed9c,657752308,-1363708304
+2ee00,-1295156710,835415532
 2ee64,-847508383,-755707576
 2eec8,-847508383,440599268
 2ef2c,-847508383,-663642880


=====================================
libraries/base/tools/ucd2haskell/ucd.sh
=====================================
@@ -12,8 +12,8 @@ VERIFY_CHECKSUM=y
 
 # Filename:checksum
 FILES="\
-  ucd/DerivedCoreProperties.txt:d367290bc0867e6b484c68370530bdd1a08b6b32404601b8c7accaf83e05628d \
-  ucd/UnicodeData.txt:806e9aed65037197f1ec85e12be6e8cd870fc5608b4de0fffd990f689f376a73"
+  ucd/DerivedCoreProperties.txt:f55d0db69123431a7317868725b1fcbf1eab6b265d756d1bd7f0f6d9f9ee108b \
+  ucd/UnicodeData.txt:2fc713e6a31a87c4850a37fe2caffa4218180fadb5de86b43a143ddb4581fb86"
 
 # Download the files
 


=====================================
libraries/base/tools/ucd2haskell/unicode_version
=====================================
@@ -1 +1 @@
-VERSION="15.0.0"
+VERSION="15.1.0"


=====================================
libraries/parsec
=====================================
@@ -1 +1 @@
-Subproject commit ddcd0cbafe7637b15fda48f1c7cf735f3ccfd8c9
+Subproject commit 4cc55b481b2eaf0606235522a6a340c10ca8dbba


=====================================
testsuite/tests/printer/Makefile
=====================================
@@ -805,3 +805,9 @@ Test23465:
 Test23887:
 	$(CHECK_PPR)   $(LIBDIR) Test23887.hs
 	$(CHECK_EXACT) $(LIBDIR) Test23887.hs
+
+.PHONY: Test23885
+Test23885:
+	# ppr is not currently unicode aware
+	# $(CHECK_PPR)   $(LIBDIR) Test23885.hs
+	$(CHECK_EXACT) $(LIBDIR) Test23885.hs


=====================================
testsuite/tests/printer/Test23885.hs
=====================================
@@ -0,0 +1,25 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
+{-# LANGUAGE UndecidableInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE UnicodeSyntax #-}
+module Test23885 where
+
+import Control.Monad (Monad(..), join, ap)
+import Data.Monoid (Monoid(..))
+import Data.Semigroup (Semigroup(..))
+
+class Monoidy to comp id m | m to → comp id where
+  munit :: id `to` m
+  mjoin :: (m `comp` m) `to` m
+
+newtype Sum a = Sum a deriving Show
+instance Num a ⇒ Monoidy (→) (,) () (Sum a) where
+  munit _ = Sum 0
+  mjoin (Sum x, Sum y) = Sum $ x + y
+
+data NT f g = NT { runNT :: ∀ α. f α → g α }


=====================================
testsuite/tests/printer/all.T
=====================================
@@ -192,4 +192,5 @@ test('HsDocTy', [ignore_stderr, req_ppr_deps], makefile_test, ['HsDocTy'])
 test('Test22765', [ignore_stderr, req_ppr_deps], makefile_test, ['Test22765'])
 test('Test22771', [ignore_stderr, req_ppr_deps], makefile_test, ['Test22771'])
 test('Test23465', [ignore_stderr, req_ppr_deps], makefile_test, ['Test23465'])
-test('Test23887', [ignore_stderr, req_ppr_deps], makefile_test, ['Test23887'])
\ No newline at end of file
+test('Test23887', [ignore_stderr, req_ppr_deps], makefile_test, ['Test23887'])
+test('Test23885', [ignore_stderr, req_ppr_deps], makefile_test, ['Test23885'])


=====================================
testsuite/tests/simplCore/should_compile/T23952.hs
=====================================
@@ -0,0 +1,31 @@
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE UndecidableInstances #-}
+
+-- The Lint failure in in #23952 is very hard to trigger.
+-- The test case fails with GHC 9.6, but not 9.4, 9.8, or HEAD.
+-- But still, better something than nothing.
+
+module T23952 where
+
+import T23952a
+import Data.Proxy
+import Data.Kind
+
+type Filter :: Type -> Type
+data Filter ty = FilterWithMain Int Bool
+
+new :: forall n . Eq n => () -> Filter n
+{-# INLINABLE new #-}
+new _ = toFilter
+
+class FilterDSL x where
+  toFilter :: Filter x
+
+instance Eq c => FilterDSL c where
+  toFilter = case (case fromRep cid == cid of
+                     True -> FilterWithMain cid False
+                     False -> FilterWithMain cid True
+                  ) of FilterWithMain c x -> FilterWithMain (c+1) (not x)
+            where cid :: Int
+                  cid = 3
+  {-# INLINE toFilter #-}


=====================================
testsuite/tests/simplCore/should_compile/T23952a.hs
=====================================
@@ -0,0 +1,14 @@
+{-# LANGUAGE DerivingVia #-}
+module T23952a where
+
+class AsRep rep a where
+  fromRep :: rep -> a
+
+newtype ViaIntegral a = ViaIntegral a
+  deriving newtype (Eq, Ord, Real, Enum, Num, Integral)
+
+instance forall a n . (Integral a, Integral n, Eq a) => AsRep a (ViaIntegral n) where
+  fromRep r = fromIntegral $ r + 2
+  {-# INLINE fromRep #-}
+
+deriving via (ViaIntegral Int) instance (Integral r) => AsRep r Int


=====================================
testsuite/tests/simplCore/should_compile/all.T
=====================================
@@ -500,3 +500,4 @@ test('T22404', [only_ways(['optasm']), check_errmsg(r'let') ], compile, ['-ddump
 test('T23864', normal, compile, ['-O -dcore-lint -package ghc -Wno-gadt-mono-local-binds'])
 test('T23938', [extra_files(['T23938A.hs'])], multimod_compile, ['T23938', '-O -v0'])
 test('T23922a', normal, compile, ['-O'])
+test('T23952', [extra_files(['T23952a.hs'])], multimod_compile, ['T23952', '-v0 -O'])


=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -4107,7 +4107,7 @@ instance ExactPrint (LocatedN RdrName) where
         NameAnn a o l c t -> do
           mn <- markName a o (Just (l,n)) c
           case mn of
-            (o', (Just (l',_n)), c') -> do -- (o', (Just (l',n')), c')
+            (o', (Just (l',_n)), c') -> do
               t' <- markTrailing t
               return (NameAnn a o' l' c' t')
             _ -> error "ExactPrint (LocatedN RdrName)"
@@ -4129,10 +4129,23 @@ instance ExactPrint (LocatedN RdrName) where
           (o',_,c') <- markName a o Nothing c
           t' <- markTrailing t
           return (NameAnnOnly a o' c' t')
-        NameAnnRArrow nl t -> do
-          (AddEpAnn _ nl') <- markKwC NoCaptureComments (AddEpAnn AnnRarrow nl)
+        NameAnnRArrow unicode o nl c t -> do
+          o' <- case o of
+            Just o0 -> do
+              (AddEpAnn _ o') <- markKwC NoCaptureComments (AddEpAnn AnnOpenP o0)
+              return (Just o')
+            Nothing -> return Nothing
+          (AddEpAnn _ nl') <-
+            if unicode
+              then markKwC NoCaptureComments (AddEpAnn AnnRarrowU nl)
+              else markKwC NoCaptureComments (AddEpAnn AnnRarrow nl)
+          c' <- case c of
+            Just c0 -> do
+              (AddEpAnn _ c') <- markKwC NoCaptureComments (AddEpAnn AnnCloseP c0)
+              return (Just c')
+            Nothing -> return Nothing
           t' <- markTrailing t
-          return (NameAnnRArrow nl' t')
+          return (NameAnnRArrow unicode o' nl' c' t')
         NameAnnQuote q name t -> do
           debugM $ "NameAnnQuote"
           (AddEpAnn _ q') <- markKwC NoCaptureComments (AddEpAnn AnnSimpleQuote q)


=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit 1130973f07aecc37a37943f4b1cc529aabd15e61
+Subproject commit d073163aacdb321c4020d575fc417a9b2368567a



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bfe15cb129710e9def49b85253e225d4c0b8e065...7ab181253996f6d5cab30d77d0ccf85474a39279

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bfe15cb129710e9def49b85253e225d4c0b8e065...7ab181253996f6d5cab30d77d0ccf85474a39279
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/20230917/f4d1e606/attachment-0001.html>


More information about the ghc-commits mailing list