Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Reorder Arbitrary instance definitions
Citing the GHC 9.0.1 changelog[1]:
Breaking change: Template Haskell splices now act as separation points
between constraint solving passes. It is no longer possible to use an
instance of a class before a splice and define that instance after a
splice. For example, this code now reports a missing instance for C
Bool:
```
class C a where foo :: a
bar :: Bool
bar = foo
$(return [])
instance C Bool where foo = True
```
In other words, code order matters in Template Haskell files, which
breaks the Haskell test build with GHC >= 9.0.1. Fix this by reordering
various Arbitrary instances so that they are defined before being used.
Also the Arbitrary instance for IAllocatorParams was silently acting as
a generic instance for (Container JSValue), providing instances for
DiskParams, HypervisorState and DiskState as well. Change the Arbitrary
instance declaration to Arbitrary (Container JSValue) to better reflect
its generic purpose.
[1] https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/9.0.1-notes.html#highlights
Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>- Loading branch information