jcpetruzza / barbies

BSD 3-Clause "New" or "Revised" License
92 stars 15 forks source link

Tests fail to build on ghc 9.2.1 #41

Closed danwdart closed 2 years ago

danwdart commented 2 years ago

Hey, getting the following:

test/TestBarbies.hs:256:19: error:
    • Non type-variable argument in the constraint: Show (Record3 f)
      (Use FlexibleContexts to permit this)
    • In the stand-alone deriving instance for
        ‘(Show (f Int), Show (Record3 f)) => Show (NestedF f)’
    |
256 | deriving instance (Show (f Int), Show (Record3 f)) => Show (NestedF f)
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/TestBarbies.hs:257:19: error:
    • Non type-variable argument in the constraint: Eq (Record3 f)
      (Use FlexibleContexts to permit this)
    • In the stand-alone deriving instance for
        ‘(Eq (f Int), Eq (Record3 f)) => Eq (NestedF f)’
    |
257 | deriving instance (Eq   (f Int), Eq   (Record3 f)) => Eq   (NestedF f)
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[10 of 12] Compiling TestBarbiesW     ( test/TestBarbiesW.hs, dist/build/barbies-test/barbies-test-tmp/TestBarbiesW.o )

test/TestBarbiesW.hs:271:19: error:
    • Non type-variable argument
        in the constraint: Show (Record3W Covered f)
      (Use FlexibleContexts to permit this)
    • In the stand-alone deriving instance for
        ‘(Show (f Int), Show (Record3W Covered f)) =>
         Show (NestedFW Covered f)’
    |
271 | deriving instance (Show (f Int), Show (Record3W Covered f)) => Show (NestedFW Covered f)
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/TestBarbiesW.hs:272:19: error:
    • Non type-variable argument
        in the constraint: Eq (Record3W Covered f)
      (Use FlexibleContexts to permit this)
    • In the stand-alone deriving instance for
        ‘(Eq (f Int), Eq (Record3W Covered f)) => Eq (NestedFW Covered f)’
    |
272 | deriving instance (Eq   (f Int), Eq   (Record3W Covered f)) => Eq   (NestedFW Covered f)
    |

Should just be a matter of turning FlexibleContexts on - it's a bug that got fixed with ghc afaik.

jcpetruzza commented 2 years ago

Thanks for reporting @danwdart! As you've noticed UndecidableInstances no longer implies FlexibleContexts in 9.2 so some FlexibleContexts will need to be added in a couple of places.

Unfortunately, I don't have 9.2 installed locally yet and it's not in stackage nightly either; happy to accept a PR in the meantime.

danwdart commented 2 years ago

I shall see if I can have a look at it and see what I can do then, in the meantime.

danwdart commented 2 years ago

There we go - that change fixes the compile on 9.2.

jcpetruzza commented 2 years ago

Thanks for the fix! Released as 2.0.3.1