Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

examples: Fix incomplete field selector warnings in AOC_2021_24 #730

Closed
wants to merge 0 commits into from

Conversation

bgamari
Copy link

@bgamari bgamari commented Dec 6, 2024

This warning was turned up by GHC's head.hackage testing.

@LeventErkok
Copy link
Owner

Hi Ben:

Which GHC generates these warnings? (I don't get any with 9.10.1

This particular example uses the exact format of the program as generated by the AOC folks, so I'm hesitant to add the new type. But I'd be OK with adding a pragma at the top to tell GHC "Don't worry about it."

Also, I'd like to understand why this is causing warnings in the first place.

Cheers..

@bgamari
Copy link
Author

bgamari commented Dec 6, 2024

@LeventErkok GHC 9.12 and later will generate this warning as it has been added to -Wall as described in GHC Proposal #516. If the newtype is problematic we can instead add a {-# OPTIONS_GHC -Wno-incomplete-record-selectors #-} pragma.

@LeventErkok
Copy link
Owner

Thanks! I suppose I’d have to do a CPP trick to allow compiling against older GHC? What would be the magic incapacitation?

@LeventErkok
Copy link
Owner

@bgamari This should fix it I suppose? e7daf24

@bgamari
Copy link
Author

bgamari commented Dec 6, 2024

For the record, it turns out that I had the version number slightly wrong here; it looks like the -Wall change will only happen in 9.14; nevertheless the flag exists in 9.12 so there is no harm done by the merged patch.

Also, I would probably use __GLASGOW_HASKELL__ >= 913 instead of MIN_VERSION_base since we care about the compiler's features, not those of the base library (although I acknowledge that they are in correspondence).

@LeventErkok
Copy link
Owner

Should that be __GLASGOW_HASKELL__ >= 914? (you said 9.14 will get the change)

@bgamari bgamari deleted the wip/fix-example branch December 6, 2024 15:16
@bgamari
Copy link
Author

bgamari commented Dec 6, 2024

Should that be __GLASGOW_HASKELL__ >= 914? (you said 9.14 will get the change)

The change is already present in GHC 9.13 (the current development version).

@LeventErkok
Copy link
Owner

Fixed! Thanks..

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.

2 participants