hspec / hspec-hedgehog

A library to integrate hedgehog tests into your hspec test suite.
https://hackage.haskell.org/package/hspec-hedgehog
Other
28 stars 6 forks source link

Compilation error with GHC 8.6.5 #10

Closed chshersh closed 3 years ago

chshersh commented 4 years ago

Thanks for maintaining this very useful package!

While using it in my packages, I noticed that recently it's started failing to build with GHC 8.6.5 with the following error:

[1 of 1] Compiling Test.Hspec.Hedgehog ( src/Test/Hspec/Hedgehog.hs, /home/shersh/haskell/sandbox/hspec-hedgehog/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hspec-hedgehog-0.0.1.2/noopt/build/Test/Hspec/Hedgehog.o )

src/Test/Hspec/Hedgehog.hs:198:66: error:
    • Couldn't match representation of type ‘tf-random-0.5:System.Random.TF.Gen.TFGen’
                               with that of ‘System.Random.SplitMix.SMGen’
        arising from a use of ‘coerce’
    • In the first argument of ‘unseedSMGen’, namely ‘(coerce rng)’
      In the second argument of ‘uncurry’, namely
        ‘(unseedSMGen (coerce rng))’
      In the first argument of ‘pure’, namely
        ‘(uncurry Seed (unseedSMGen (coerce rng)))’
    |
198 |                Just (rng, _) -> pure (uncurry Seed (unseedSMGen (coerce rng)))
    |                                                                  ^^^^^^^^^^

Would it be possible to patch the code to make hspec-hedgehog build with GHC 8.6.5?

parsonsmatt commented 4 years ago

Yeah, should be possible! Looks like we have a mismatch on the random version using a different generator. Version bounds or CPP are probably the right choice here.

chshersh commented 3 years ago

This seems to be resolved now as hspec-hedgehog started building on GHC 8.6.5 again. So I'm closing this issue.