Skip to content

Commit 795077a

Browse files
author
David Binder
committed
Add documentation for GHC-05661
1 parent 762580b commit 795077a

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{-# LANGUAGE ImportQualifiedPost #-}
2+
module DoubleQualified where
3+
4+
import Prelude qualified
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{-# LANGUAGE ImportQualifiedPost #-}
2+
module DoubleQualified where
3+
4+
import qualified Prelude qualified
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: The module Prelude is incorrectly imported as qualified
3+
---
4+
5+
In this example, the `qualified` modifier was used both before and after the name of the module which is imported.
6+
This is not legal syntax, and GHC emits this error message.
7+
The error can be fixed by removing one of the two occurrences.
8+
9+
```
10+
messages/GHC-05661/doubleQualified/before/DoubleQualified.hs:4:26: error: [GHC-05661]
11+
Multiple occurrences of 'qualified'
12+
|
13+
4 | import qualified Prelude qualified
14+
| ^^^^^^^^^
15+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Cannot use qualified in pre and postpositive position
3+
summary: A module cannot be imported using the qualified modifier in pre and postpositive position
4+
severity: error
5+
introduced: 9.6.1
6+
---
7+
8+
With the language extension `ImportQualifiedPost` it is possible to import a module using the `qualified` modifier after the name of the module. But it is not legal to use the `qualified` modifier both before and after the name of the module.

0 commit comments

Comments
 (0)