Skip to content

Commit 2bdc711

Browse files
committed
Add message for GHC-87491
1 parent 70c332c commit 2bdc711

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# LANGUAGE Haskell2010 #-}
2+
{-# LANGUAGE ImportQualifiedPost #-}
3+
4+
module ImportQualifiedPost where
5+
6+
import Prelude qualified
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{-# LANGUAGE Haskell2010 #-}
2+
3+
module ImportQualifiedPost where
4+
5+
import Prelude qualified
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Found 'qualified' after the module
3+
---
4+
5+
This file is written in `Haskell2010` which doesn't have the
6+
`ImportQualifiedPost` extension. To fix this you need to either turn on
7+
`ImportQualifiedPost`, or change the `qualified` keyword to be prefix.
8+
9+
## Error Message
10+
```
11+
ImportQualifiedPost:5:16: error: [GHC-87491]
12+
Found `qualified' in postpositive position.
13+
Suggested fix: Perhaps you intended to use ImportQualifiedPost
14+
|
15+
5 | import Prelude qualified
16+
| ^^^^^^^^^
17+
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Found 'qualified' after the module
3+
summary: qualified after the module requires the ImportQualifiedPost extension.
4+
severity: error
5+
introduced: 8.10.1
6+
---
7+
8+
The [`ImportQualifiedPost extension`](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/import_qualified_post.html),
9+
allows you to put the `qualified` keyword after the module in imports, without
10+
this it must be before the module.
11+
This is part of the [`GHC2021`](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html#extension-GHC2021)
12+
extension set.

0 commit comments

Comments
 (0)