Skip to content

Add support for GHC 9.10, remove support for GHC 9.4#24

Merged
tfausak merged 8 commits intomainfrom
2024-05-16-ghc-9.10
May 17, 2024
Merged

Add support for GHC 9.10, remove support for GHC 9.4#24
tfausak merged 8 commits intomainfrom
2024-05-16-ghc-9.10

Conversation

@tfausak
Copy link
Copy Markdown
Owner

@tfausak tfausak commented May 17, 2024

No description provided.

@tfausak
Copy link
Copy Markdown
Owner Author

tfausak commented May 17, 2024

I'm getting a warning here with GHC 9.10.1:

imports =
Set.fromList
. fmap (ImportDecl.toModuleName . Plugin.unLoc)
. Hs.hsmodImports
$ Plugin.unLoc lHsModule

The warning is:

source/library/Imp.hs:86:13: warning: [GHC-17335] [-Wincomplete-record-selectors]
    The application of the record field ‘Hs.hsmodImports’ may fail for the following constructors: Hs.XModule
   |
86 |           . Hs.hsmodImports
   |             ^^^^^^^^^^^^^^^

I think that's incorrect because the HsModule type effectively only has one constructor for the GhcPs pass: https://hackage.haskell.org/package/ghc-9.10.1/docs/GHC-Hs.html#t:HsModule

And indeed trying to avoid the warning just generates a different warning:

source/library/Imp.hs:88:9: warning: [GHC-53633] [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: Hs.XModule {} -> ...
   |
88 |         Hs.XModule {} -> Set.empty
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

I think this is a GHC bug.

@tfausak
Copy link
Copy Markdown
Owner Author

tfausak commented May 17, 2024

I worked around the problem by using positional arguments instead of record selectors. I also created an upstream issue: https://gitlab.haskell.org/ghc/ghc/-/issues/24824

@tfausak tfausak marked this pull request as ready for review May 17, 2024 02:12
@tfausak tfausak changed the title Upgrade to GHC 9.10 Add support for GHC 9.10, remove support for GHC 9.4 May 17, 2024
@tfausak tfausak merged commit 6b8bb95 into main May 17, 2024
@tfausak tfausak deleted the 2024-05-16-ghc-9.10 branch May 17, 2024 13:23
@tfausak
Copy link
Copy Markdown
Owner Author

tfausak commented May 17, 2024

This page is very useful and I always have trouble finding it:
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant