-
Notifications
You must be signed in to change notification settings - Fork 71
Add message for GHC-72771 "Mismatched default method signature" #524
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
Conversation
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`. |
There was a problem hiding this comment.
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:
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..] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
If you rename it to
module Lib where
there would be no need to definemain :: IO ()
, minimizing the example. -
Let's add
{-# LANGUAGE TypeOperators #-}
, otherwise recent GHCs throw a warning about~
. -
Could we please rename
Enum -> Enumerate
,enum -> enumerate
? So that we do not clash with a usualclass Enum
fromPrelude
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that all sounds much better!
I made changes accordingly.
66209a5
to
5e5ae3d
Compare
8624c5b
to
c06423e
Compare
c06423e
to
c503cf9
Compare
Thanks! |
No description provided.