diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2020-04-21 10:53:28 -0400 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2020-04-21 08:06:45 -0700 |
commit | 5bc5016a14bc872a8315cddc629f8171a9ccd62e (patch) | |
tree | ff26691fdd58d13240668cad0e4175ea5de5c4d2 /html-test/src | |
parent | 83f0fa0b6218c34898337bf41072ee5fedec1bde (diff) |
Fallback to `hiDecl` when `extractDecl` fails
Sometimes, the declaration being exported is a subdecl (for instance, a
record accessor getting exported at the top-level). For these cases,
Haddock has to find a way to produce some synthetic sensible top-level
declaration. This is done with `extractDecl`.
As is shown by #1067, this is sometimes impossible to do just at a
syntactic level (for instance when the subdecl is re-exported). In these
cases, the only sensible thing to do is to try to reify a declaration
based on a GHC `TyThing` via `hiDecl`.
Diffstat (limited to 'html-test/src')
-rw-r--r-- | html-test/src/Bug1067A.hs | 9 | ||||
-rw-r--r-- | html-test/src/Bug1067B.hs | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/html-test/src/Bug1067A.hs b/html-test/src/Bug1067A.hs new file mode 100644 index 00000000..57ab60b0 --- /dev/null +++ b/html-test/src/Bug1067A.hs @@ -0,0 +1,9 @@ +{-# language PatternSynonyms #-} +module Bug1067A ( Foo(P) ) where + +-- | A foo +data Foo = Foo + +-- | A pattern +pattern P :: Foo +pattern P = Foo diff --git a/html-test/src/Bug1067B.hs b/html-test/src/Bug1067B.hs new file mode 100644 index 00000000..f1a814df --- /dev/null +++ b/html-test/src/Bug1067B.hs @@ -0,0 +1,4 @@ +{-# language PatternSynonyms #-} +module Bug1067B ( pattern P ) where + +import Bug1067A |