File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
message-index/messages/GHC-24922 Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE TemplateHaskell #-}
2
+
3
+ module CannotReifyOutOfScopeThing where
4
+
5
+ import Language.Haskell.TH
6
+
7
+ doesn'tExist = " I do so!"
8
+
9
+ do t <- reifyType (mkName " doesn'tExist" )
10
+ return []
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE TemplateHaskell #-}
2
+
3
+ module CannotReifyOutOfScopeThing where
4
+
5
+ import Language.Haskell.TH
6
+
7
+ do t <- reifyType (mkName " doesn'tExist" )
8
+ return []
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Cannot reify type because name is not in scope
3
+ ---
4
+
5
+ GHC fails with an error because the requested name is not in scope.
6
+
7
+ ## Error Message
8
+
9
+ ``` haskell
10
+ CannotReifyOutOfScopeThing. hs: 7 : 1 : error : [GHC - 24922 ]
11
+ ‘ doesn'tExist’ is not in scope at a reify
12
+ |
13
+ 7 | do t <- reifyType (mkName " doesn'tExist" )
14
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
15
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Cannot reify type because name is not in scope
3
+ summary : A Template Haskell error indicating that the given name is not in scope and therefore cannot be reified.
4
+ severity : error
5
+ introduced : 9.6.1
6
+ ---
7
+
8
+ The [ Template Haskell] [ ` reifyType ` ] [ haddock-reifyType ] function
9
+ returns the type or kind of a given name:
10
+
11
+ ``` haskell
12
+ reifyType :: Name -> Q Type
13
+ ```
14
+
15
+ If the name is not in scope, GHC fails with error ** GHC - 24922 **.
16
+ The name has possibly been misspelled, or needs to be defined or
17
+ brought into scope.
18
+
19
+ [Template Haskell ]: https:// ghc. gitlab. haskell. org/ ghc/ doc/ users_guide/ exts/ template_haskell. html
20
+ [haddock- reifyType]: https:// hackage. haskell. org/ package/ template- haskell- 2.22 . 0.0 / docs/ Language - Haskell - TH. html# v: reifyType
You can’t perform that action at this time.
0 commit comments