summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile/unused_haddock.hs
diff options
context:
space:
mode:
authorZubin Duggal <zubin@cmi.ac.in>2022-03-12 00:07:56 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-03-22 22:16:48 +0000
commit26819793f836f29f7c04ac0ac9c43d363eb5beb8 (patch)
tree406809b6a923bb84d1370874500017e69c6681d9 /testsuite/tests/rename/should_compile/unused_haddock.hs
parentd45bb70178e044bc8b6e8215da7bc8ed0c95f2cb (diff)
downloadhaskell-wip/hi-haddock2021.tar.gz
hi haddock: Lex and store haddock docs in interface fileswip/hi-haddock2021
Names appearing in Haddock docstrings are lexed and renamed like any other names appearing in the AST. We currently rename names irrespective of the namespace, so both type and constructor names corresponding to an identifier will appear in the docstring. Haddock will select a given name as the link destination based on its own heuristics. This patch also restricts the limitation of `-haddock` being incompatible with `Opt_KeepRawTokenStream`. The export and documenation structure is now computed in GHC and serialised in .hi files. This can be used by haddock to directly generate doc pages without reparsing or renaming the source. At the moment the operation of haddock is not modified, that's left to a future patch. Updates the haddock submodule with the minimum changes needed.
Diffstat (limited to 'testsuite/tests/rename/should_compile/unused_haddock.hs')
-rw-r--r--testsuite/tests/rename/should_compile/unused_haddock.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/unused_haddock.hs b/testsuite/tests/rename/should_compile/unused_haddock.hs
new file mode 100644
index 0000000000..ecf14de910
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/unused_haddock.hs
@@ -0,0 +1,8 @@
+module UnusedHaddock (qux) where
+
+foo :: String
+foo = "abc"
+
+-- | A version of 'foo'
+qux :: ()
+qux = ()