diff --git a/message-index/messages/GHC-15708/example1/after/FunDepsDisabled.hs b/message-index/messages/GHC-15708/example1/after/FunDepsDisabled.hs new file mode 100644 index 00000000..9e06e512 --- /dev/null +++ b/message-index/messages/GHC-15708/example1/after/FunDepsDisabled.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE FunctionalDependencies #-} + +module FunDepsDisabled where + +class Convert a b | a -> b where + convert :: a -> b diff --git a/message-index/messages/GHC-15708/example1/before/FunDepsDisabled.hs b/message-index/messages/GHC-15708/example1/before/FunDepsDisabled.hs new file mode 100644 index 00000000..12de7d57 --- /dev/null +++ b/message-index/messages/GHC-15708/example1/before/FunDepsDisabled.hs @@ -0,0 +1,4 @@ +module FunDepsDisabled where + +class Convert a b | a -> b where + convert :: a -> b diff --git a/message-index/messages/GHC-15708/example1/index.md b/message-index/messages/GHC-15708/example1/index.md new file mode 100644 index 00000000..c49e252b --- /dev/null +++ b/message-index/messages/GHC-15708/example1/index.md @@ -0,0 +1,17 @@ +--- +title: Missing FunctionalDependencies language extension +--- + +Cannot specify functional dependencies for a class - `FunctionalDependencies` language extension is missing. + +## Error Message + +``` +FunDepsDisabled.hs:1:1: error: [GHC-15708] + • Fundeps in class ‘Convert’ + • In the class declaration for ‘Convert’ + Suggested fix: Perhaps you intended to use FunctionalDependencies + | +1 | class Convert a b | a -> b where + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... +``` diff --git a/message-index/messages/GHC-15708/index.md b/message-index/messages/GHC-15708/index.md new file mode 100644 index 00000000..ac63c3d4 --- /dev/null +++ b/message-index/messages/GHC-15708/index.md @@ -0,0 +1,10 @@ +--- +title: Missing FunctionalDependencies +summary: Missing FunctionalDependencies language extension +severity: error +introduced: 9.6.1 +--- + +The [Functional Dependencies extension](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/functional_dependencies.html) enables dependencies in multiparameter class declarations. + +When the extension is missing, the syntax for specifying dependencies is not recognized.