forked from haskellfoundation/error-message-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request haskellfoundation#396 from BinderDavid/add-error-4…
…4432 Add error message for error GHC-44432
- Loading branch information
Showing
13 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
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: Type signature lacks an accompanying binding | ||
summary: A type signature was provided, but no binding was given. | ||
severity: error | ||
introduced: 9.6.1 | ||
--- | ||
|
||
If a type signature is given for a name, then that name also needs to be defined. |
9 changes: 9 additions & 0 deletions
9
message-index/messages/GHC-44432/let-binding/after/MissingBinding.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,9 @@ | ||
module MissingBinding where | ||
|
||
fortytwo :: Integer | ||
fortytwo = | ||
let | ||
two :: Integer | ||
two = 2 | ||
in | ||
40 + two |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-44432/let-binding/before/MissingBinding.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 MissingBinding where | ||
|
||
fortytwo :: Integer | ||
fortytwo = | ||
let | ||
two :: Integer | ||
in | ||
40 + two |
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,18 @@ | ||
--- | ||
title: Type signature lacks an accompanying binding | ||
--- | ||
|
||
If a type signature is given for a name in a local let expression, then the name also needs to be defined. | ||
|
||
In this example, a type signature was given for the name `two` in a let expression, but no definition was specified. | ||
This error can be fixed by adding a definition which accompanies the type signature. | ||
|
||
## Error Message | ||
|
||
``` | ||
MissingBinding.hs:6:5: error: [GHC-44432] | ||
The type signature for ‘two’ lacks an accompanying binding | ||
| | ||
6 | two :: Integer | ||
| ^^^ | ||
``` |
4 changes: 4 additions & 0 deletions
4
message-index/messages/GHC-44432/toplevel/after/MissingBinding.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 @@ | ||
module MissingBinding where | ||
|
||
someBoolean :: Bool | ||
someBoolean = True |
3 changes: 3 additions & 0 deletions
3
message-index/messages/GHC-44432/toplevel/before/MissingBinding.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,3 @@ | ||
module MissingBinding where | ||
|
||
someBoolean :: Bool |
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,18 @@ | ||
--- | ||
title: Type signature lacks an accompanying binding | ||
--- | ||
|
||
If a type signature is given for a name in a Haskell module, then the name also needs to be defined. | ||
|
||
In this example, a type signature was given for the name `someBoolean` in a Haskell module, but no definition was specified. | ||
This error can be fixed by adding a definition which accompanies the type signature. | ||
|
||
## Error Message | ||
|
||
``` | ||
MissingBinding.hs:3:1: error: [GHC-44432] | ||
The type signature for ‘someBoolean’ lacks an accompanying binding | ||
| | ||
3 | someBoolean :: Bool | ||
| ^^^^^^^^^^^ | ||
``` |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-44432/typo/after/MissingBinding.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 MissingBinding where | ||
|
||
import Numeric.Natural | ||
|
||
factorial :: Natural -> Natural | ||
factorial n | ||
| n == 0 = 1 | ||
| otherwise = n * factorial (n - 1) |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-44432/typo/before/MissingBinding.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 MissingBinding where | ||
|
||
import Numeric.Natural | ||
|
||
factorial :: Natural -> Natural | ||
fatcorial n | ||
| n == 0 = 1 | ||
| otherwise = n * factorial (n - 1) |
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,20 @@ | ||
--- | ||
title: Type signature lacks an accompanying binding | ||
--- | ||
|
||
If a type signature is given for a name in a Haskell module, then the name also needs to be defined. | ||
|
||
In this example, the programmer misspelt the name `factorial`. | ||
GHC helpfully suggests that `fatcorial` might be the intended spelling. | ||
The error can be fixed by correcting the typo. | ||
|
||
## Error Message | ||
|
||
``` | ||
MissingBinding.hs:5:1: error: [GHC-44432] | ||
The type signature for ‘factorial’ lacks an accompanying binding | ||
Suggested fix: Perhaps use ‘fatcorial’ (Defined at Main.hs:6:1) | ||
| | ||
5 | factorial :: Natural -> Natural | ||
| ^^^^^^^^^ | ||
``` |
7 changes: 7 additions & 0 deletions
7
message-index/messages/GHC-44432/where-clause/after/MissingBinding.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,7 @@ | ||
module MissingBinding where | ||
|
||
fortytwo :: Integer | ||
fortytwo = 40 + two | ||
where | ||
two :: Integer | ||
two = 2 |
6 changes: 6 additions & 0 deletions
6
message-index/messages/GHC-44432/where-clause/before/MissingBinding.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,6 @@ | ||
module MissingBinding where | ||
|
||
fortytwo :: Integer | ||
fortytwo = 40 + two | ||
where | ||
two :: Integer |
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,18 @@ | ||
--- | ||
title: Type signature lacks an accompanying binding | ||
--- | ||
|
||
If a type signature is given for a name in a where clause, then the name also needs to be defined. | ||
|
||
In this example, a type signature was given for the name `two` in a where clause, but no definition was specified. | ||
This error can be fixed by adding a definition which accompanies the type signature. | ||
|
||
## Error Message | ||
|
||
``` | ||
MissingBinding.hs:6:5: error: [GHC-44432] | ||
The type signature for ‘two’ lacks an accompanying binding | ||
| | ||
6 | two :: Integer | ||
| ^^^ | ||
``` |