[Git][ghc/ghc][master] Scrub a use of `head` in `GHC.Driver.Make.downsweep_imports.checkDuplicates`.

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Feb 20 01:26:36 UTC 2025



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
aa69187d by M Farkas-Dyck at 2025-02-19T20:25:31-05:00
Scrub a use of `head` in `GHC.Driver.Make.downsweep_imports.checkDuplicates`.

- - - - -


1 changed file:

- compiler/GHC/Driver/Make.hs


Changes:

=====================================
compiler/GHC/Driver/Make.hs
=====================================
@@ -1682,9 +1682,9 @@ downsweep_imports hsc_env old_summaries excl_mods allow_dup_roots (root_errs, ro
           :: DownsweepCache
           -> IO ()
         checkDuplicates root_map
-           | allow_dup_roots = return ()
-           | null dup_roots  = return ()
-           | otherwise       = liftIO $ multiRootsErr (head dup_roots)
+           | not allow_dup_roots
+           , dup_root:_ <- dup_roots = liftIO $ multiRootsErr dup_root
+           | otherwise = pure ()
            where
              dup_roots :: [[ModSummary]]        -- Each at least of length 2
              dup_roots = filterOut isSingleton $ map rights (M.elems root_map)



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa69187d45a5697507c1c609cebe15113c20f452
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/20250219/3a3a1167/attachment-0001.html>


More information about the ghc-commits mailing list