-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for GHC-94458 and GHC-05661 #422
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
message-index/messages/GHC-05661/doubleQualified/after/DoubleQualified.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{-# LANGUAGE ImportQualifiedPost #-} | ||
module DoubleQualified where | ||
|
||
import Prelude qualified |
4 changes: 4 additions & 0 deletions
4
message-index/messages/GHC-05661/doubleQualified/before/DoubleQualified.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{-# LANGUAGE ImportQualifiedPost #-} | ||
module DoubleQualified where | ||
|
||
import qualified Prelude qualified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: The module Prelude is incorrectly imported as qualified | ||
--- | ||
|
||
In this example, the `qualified` modifier was used both before and after the name of the module which is imported. | ||
This is not legal syntax, and GHC emits this error message. | ||
The error can be fixed by removing one of the two occurrences. | ||
|
||
``` | ||
messages/GHC-05661/doubleQualified/before/DoubleQualified.hs:4:26: error: [GHC-05661] | ||
Multiple occurrences of 'qualified' | ||
| | ||
4 | import qualified Prelude qualified | ||
| ^^^^^^^^^ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Cannot use qualified in pre and postpositive position | ||
summary: A module cannot be imported using the qualified modifier in pre and postpositive position | ||
severity: error | ||
introduced: 9.6.1 | ||
--- | ||
|
||
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. |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-94458/illegalHaddockComment/after/IllegalHaddockComment.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module IllegalHaddockComment where | ||
|
||
main = print (fizz ++ buzz) | ||
where | ||
-- The sound of a refreshing beverage. | ||
fizz = "fizz" | ||
-- The sound of an annoying fly. | ||
buzz = "buzz" |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-94458/illegalHaddockComment/before/IllegalHaddockComment.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module IllegalHaddockComment where | ||
|
||
main = print (fizz ++ buzz) | ||
where | ||
-- | The sound of a refreshing beverage. | ||
fizz = "fizz" | ||
-- | The sound of an annoying fly. | ||
buzz = "buzz" |
21 changes: 21 additions & 0 deletions
21
message-index/messages/GHC-94458/illegalHaddockComment/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: Illegal Haddock comments for definitions in where clause | ||
--- | ||
|
||
In this example, the user tried to document the two identifiers `fizz` and `buzz` that are introduced in a local `where` clause. | ||
Since these identifiers are not part of the public API, a warning is emitted that Haddock comments are not allowed in that place. | ||
A normal comment can be used instead. | ||
|
||
``` | ||
messages/GHC-94458/illegalHaddockComment/before/IllegalHaddockComment.hs:5:5: warning: [GHC-94458] [-Winvalid-haddock] | ||
A Haddock comment cannot appear in this position and will be ignored. | ||
| | ||
5 | -- | The sound of a refreshing beverage. | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
messages/GHC-94458/illegalHaddockComment/before/IllegalHaddockComment.hs:7:5: warning: [GHC-94458] [-Winvalid-haddock] | ||
A Haddock comment cannot appear in this position and will be ignored. | ||
| | ||
7 | -- | The sound of an annoying fly. | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Illegal position of Haddock comment | ||
summary: A Haddock comment appears in an illegal position | ||
severity: warning | ||
flag: -Winvalid-haddock | ||
introduced: 9.6.1 | ||
--- | ||
|
||
Haddock comments are used to document entities of Haskell programs, and are used to generate API documentation which can be displayed on Hackage or as tooltips in editors. This error is emitted when a Haddock comment is attached to an entity that cannot be documented this way. A normal comment should be used instead. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand "postpositive" here - what about: