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

Add message for GHC-72771 "Mismatched default method signature" #524

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VeryMilkyJoe
Copy link

No description provided.

introduced: 9.8.1
---

This error means that there is a type class with some method `m` for which a [default signature](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/default_signatures.html) was defined, but that default signature does not match the type signature of `m`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's link a stable released documentation instead of GitLab:

Suggested change
This error means that there is a type class with some method `m` for which a [default signature](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/default_signatures.html) was defined, but that default signature does not match the type signature of `m`.
This error means that there is a type class with some method `m` for which a [default signature](https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/default_signatures.html) was defined, but that default signature does not match the type signature of `m`.

class Enum a where
enum :: [a]
default enum :: (Int ~ a) => a
enum = [1..]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If you rename it to module Lib where there would be no need to define main :: IO (), minimizing the example.

  2. Let's add {-# LANGUAGE TypeOperators #-}, otherwise recent GHCs throw a warning about ~.

  3. Could we please rename Enum -> Enumerate, enum -> enumerate? So that we do not clash with a usual class Enum from Prelude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants