Skip to content

Commit

Permalink
Document GHC-46537 Unsupported extension (closes #150)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrcek committed Apr 16, 2023
1 parent 3373fc9 commit 6d7da5c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{-# LANGUAGE ExistentialQuantification #-}

module UnsupportedExtension where
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{-# LANGUAGE ExistientialQuantification #-}
-- typo here ^
module UnsupportedExtension where
14 changes: 14 additions & 0 deletions message-index/messages/GHC-46537/example1/index.md
Original file line number Diff line number Diff line change
@@ -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 #-}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
```
24 changes: 24 additions & 0 deletions message-index/messages/GHC-46537/index.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 6d7da5c

Please sign in to comment.