Skip to content

Incorrect constraint warnings from ghc 9.2.4

Summary

With the constraint, I get a redundant constraint warning and without it, i get a missing constraint warning.

Steps to reproduce

Minimal reproduction case redundant-constraint.tgz

WIth the code in the tarball I get:

    • Redundant constraints: (Applicative m, Monad m)
    • In the instance declaration for ‘ReportSchemaErrors m’

If I remove those constraints I get:

    • Could not deduce (Applicative m)
    • Could not deduce (Monad m)

The constraint cannot be both redundant and required.

If the class declaration is in the same file as the instance decalration its fine.

Expected behavior

After removing the redundant constraints, there should be no warning.

Environment

  • GHC version used: 9.2.4

Optional:

  • Operating System: Linux
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information