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

ghc-9.2.4 compatibility #4009

Closed
wants to merge 13 commits into from
Closed

ghc-9.2.4 compatibility #4009

wants to merge 13 commits into from

Conversation

angerman
Copy link
Contributor

This merges #4003 and #4001, and tries to look at the codebase with 9.2.4

I'm not sure the FlexibleContexts fix is proper.

@angerman
Copy link
Contributor Author

For reference, this is the error 9.2.4 provides:

	src/Ouroboros/Network/Testing/ConcreteBlock.hs:124:10: error:
	    • Non type-variable argument
	        in the constraint: Hashable (HeaderHash b)
	      (Use FlexibleContexts to permit this)
	    • In the instance declaration for ‘Hashable (ChainHash b)’
	    |
	124 | instance Hashable (HeaderHash b) => Hashable (ChainHash b)
	    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

following the FlexibleContexts suggestion, GHC then suggests:

src/Ouroboros/Network/Testing/ConcreteBlock.hs:125:10: error:
    • Could not deduce (StandardHash b)
        arising from the superclasses of an instance declaration
      from the context: Hashable (HeaderHash b)
        bound by the instance declaration
        at src/Ouroboros/Network/Testing/ConcreteBlock.hs:125:10-58
      Possible fix:
        add (StandardHash b) to the context of the instance declaration
    • In the instance declaration for ‘Hashable (ChainHash b)’
    |
125 | instance Hashable (HeaderHash b) => Hashable (ChainHash b)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

which leaves us with this fix, but that feels rather fishy.

@angerman angerman closed this Nov 23, 2022
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