-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc1f169
commit bd4645f
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
message-index/messages/GHC-24922/example/after/CannotReifyOutOfScopeThing.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,10 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
module CannotReifyOutOfScopeThing where | ||
|
||
import Language.Haskell.TH | ||
|
||
doesn'tExist = "I do so!" | ||
|
||
do t <- reifyType (mkName "doesn'tExist") | ||
return [] |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-24922/example/before/CannotReifyOutOfScopeThing.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 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
module CannotReifyOutOfScopeThing where | ||
|
||
import Language.Haskell.TH | ||
|
||
do t <- reifyType (mkName "doesn'tExist") | ||
return [] |
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: Cannot reify type because name is not in scope | ||
--- | ||
|
||
GHC fails with an error because the requested name is not in scope. | ||
|
||
## Error Message | ||
|
||
```haskell | ||
CannotReifyOutOfScopeThing.hs:7:1: error: [GHC-24922] | ||
‘doesn'tExist’ is not in scope at a reify | ||
| | ||
7 | do t <- reifyType (mkName "doesn'tExist") | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... | ||
``` |
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: Cannot reify type because name is not in scope | ||
summary: A Template Haskell error indicating that the given name is not in scope and therefore cannot be reified. | ||
severity: error | ||
introduced: 9.6.1 | ||
--- | ||
|
||
The [Template Haskell] [`reifyType`][haddock-reifyType] function | ||
returns the type or kind of a given name: | ||
|
||
```haskell | ||
reifyType :: Name -> Q Type | ||
``` | ||
|
||
If the name is not in scope, GHC fails with error **GHC-24922**. | ||
The name has possibly been misspelled, or needs to be defined or | ||
brought into scope. | ||
|
||
[Template Haskell]: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/template_haskell.html | ||
[haddock-reifyType]: https://hackage.haskell.org/package/template-haskell-2.22.0.0/docs/Language-Haskell-TH.html#v:reifyType |