Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid -Wincomplete-uni-patterns in generated splices #94

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

sorki
Copy link
Contributor

@sorki sorki commented Dec 15, 2023

Resolves warnings coming from TH splices, like

src/Ivory/Compile/C/Gen.hs:314:25: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type C.Type not matched:
            C.AntiType _ _
            C.Type (C.AntiDeclSpec _ _) _ _
            C.Type (C.AntiTypeDeclSpec _ _ _ _) _ _
    |
314 |       [C.BlockStm [cstm| for( $ty:(toType ty) $id:(toVar var)

Language/C/Quote/Base.hs Outdated Show resolved Hide resolved
@sorki sorki mentioned this pull request Dec 15, 2023
@sorki sorki force-pushed the srk/incomplete-uni-patterns branch from f6a405c to 4a74cc6 Compare December 16, 2023 06:07
@athas
Copy link
Collaborator

athas commented Dec 16, 2023

You'll need to change those <>s to ++ for this to work on the various old GHCs that language-c-quote still supports.

Resolves warnings coming from TH splices, like

```haskell
src/Ivory/Compile/C/Gen.hs:314:25: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘C.Type’ not matched:
            C.AntiType _ _
            C.Type (C.AntiDeclSpec _ _) _ _
            C.Type (C.AntiTypeDeclSpec _ _ _ _) _ _
    |
314 |       [C.BlockStm [cstm| for( $ty:(toType ty) $id:(toVar var)
```
@sorki sorki force-pushed the srk/incomplete-uni-patterns branch from 4a74cc6 to 2eb249d Compare December 16, 2023 09:17
@sorki
Copy link
Contributor Author

sorki commented Dec 16, 2023

You'll need to change those <>s to ++ for this to work on the various old GHCs that language-c-quote still supports.

Ah, of course, that's why CI fails. Thanks!

@athas athas merged commit a27ebb2 into mainland:main Dec 16, 2023
14 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants