getDoc silently returns Nothing for TH generated Name defined in the same module
Hi,
I implemented a TH macros for copying Haddocks from one function to another and noticed that GHC doesn't complain anyhow if TH macro refers a function also generated with TH in the same module and returns Nothing nonetheless the function has haddocks. Once referred function is moved into a another module getDoc returns haddocks for it.
I think getDoc should check origin of the name and calling module and if GHC marks generated functions somehow then it can detect the error and stop compilation or issue warning at least.
GHC-9.2.5