From 6d7da5c5d724bc128c58677a8c73dc4d918017d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sun, 16 Apr 2023 10:19:25 +0200 Subject: [PATCH] Document GHC-46537 Unsupported extension (closes #150) --- .../example1/after/UnsupportedExtension.hs | 3 +++ .../example1/before/UnsupportedExtension.hs | 3 +++ .../messages/GHC-46537/example1/index.md | 14 +++++++++++ message-index/messages/GHC-46537/index.md | 24 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 message-index/messages/GHC-46537/example1/after/UnsupportedExtension.hs create mode 100644 message-index/messages/GHC-46537/example1/before/UnsupportedExtension.hs create mode 100644 message-index/messages/GHC-46537/example1/index.md create mode 100644 message-index/messages/GHC-46537/index.md diff --git a/message-index/messages/GHC-46537/example1/after/UnsupportedExtension.hs b/message-index/messages/GHC-46537/example1/after/UnsupportedExtension.hs new file mode 100644 index 00000000..97c683cb --- /dev/null +++ b/message-index/messages/GHC-46537/example1/after/UnsupportedExtension.hs @@ -0,0 +1,3 @@ +{-# LANGUAGE ExistentialQuantification #-} + +module UnsupportedExtension where diff --git a/message-index/messages/GHC-46537/example1/before/UnsupportedExtension.hs b/message-index/messages/GHC-46537/example1/before/UnsupportedExtension.hs new file mode 100644 index 00000000..782c78a8 --- /dev/null +++ b/message-index/messages/GHC-46537/example1/before/UnsupportedExtension.hs @@ -0,0 +1,3 @@ +{-# LANGUAGE ExistientialQuantification #-} +-- typo here ^ +module UnsupportedExtension where diff --git a/message-index/messages/GHC-46537/example1/index.md b/message-index/messages/GHC-46537/example1/index.md new file mode 100644 index 00000000..59e23e52 --- /dev/null +++ b/message-index/messages/GHC-46537/example1/index.md @@ -0,0 +1,14 @@ +--- +title: Unsupported extension +--- + +## Error Message +``` +Main.hs:1:14: error: [GHC-46537] + Unsupported extension: ExistientialQuantification + Suggested fix: + Perhaps you meant ‘ExistentialQuantification’ or ‘NoExistentialQuantification’ + | +1 | {-# LANGUAGE ExistientialQuantification #-} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +``` diff --git a/message-index/messages/GHC-46537/index.md b/message-index/messages/GHC-46537/index.md new file mode 100644 index 00000000..962e00c4 --- /dev/null +++ b/message-index/messages/GHC-46537/index.md @@ -0,0 +1,24 @@ +--- +title: Unsupported extension +summary: GHC failed to recognize name of a language extension +severity: error +introduced: 9.6.1 +--- + +This error is reported when GHC fails to recognize the name of a language extension, provided via `{-# LANGUAGE ... #-}` pragma at the top of a `.hs` file. + +There are two likely causes: + +1. You've made a typo, in which case ghc will likely also suggest the correct extension name to use. +2. You're using older version of GHC which doesn't yet support given extension. + Here's a couple of things you can try to troubleshoot: + + - Find out what version of GHC you're using: + + ghc --version + + - List all the supported extension that this version of GHC supports. Does the list contain your desired extension? + + ghc --supported-extensions + + - Search for the extension name in the latest version of [GHC User's Guide](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts.html). Most extensions have a `since` annotation which tells you in which version of GHC the extension was introduced.