diff --git a/html-test/ref/T24294.html b/html-test/ref/T24294.html
new file mode 100644
index 0000000000000000000000000000000000000000..37a918af86c9711705bdb3539b353035f5a203e0
--- /dev/null
+++ b/html-test/ref/T24294.html
@@ -0,0 +1,84 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+  ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+     /><meta name="viewport" content="width=device-width, initial-scale=1"
+     /><title
+    >T24294</title
+    ><link href="#" rel="stylesheet" type="text/css" title="Linuwial"
+     /><link rel="stylesheet" type="text/css" href="#"
+     /><link rel="stylesheet" type="text/css" href="#"
+     /><script src="haddock-bundle.min.js" async="async" type="text/javascript"
+    ></script
+    ><script type="text/x-mathjax-config"
+    >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script
+    ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"
+    ></script
+    ></head
+  ><body
+  ><div id="package-header"
+    ><span class="caption empty"
+      >&nbsp;</span
+      ><ul class="links" id="page-menu"
+      ><li
+	><a href="#"
+	  >Contents</a
+	  ></li
+	><li
+	><a href="#"
+	  >Index</a
+	  ></li
+	></ul
+      ></div
+    ><div id="content"
+    ><div id="module-header"
+      ><table class="info"
+	><tr
+	  ><th
+	    >Safe Haskell</th
+	    ><td
+	    >None</td
+	    ></tr
+	  ></table
+	><p class="caption"
+	>T24294</p
+	></div
+      ><div id="synopsis"
+      ><details id="syn"
+	><summary
+	  >Synopsis</summary
+	  ><ul class="details-toggle" data-details-id="syn"
+	  ><li class="src short"
+	    ><a href="#"
+	      >unfoldr</a
+	      > :: a</li
+	    ></ul
+	  ></details
+	></div
+      ><div id="interface"
+      ><h1
+	>Documentation</h1
+	><div class="top"
+	><p class="src"
+	  ><a id="v:unfoldr" class="def"
+	    >unfoldr</a
+	    > :: a <a href="#" class="selflink"
+	    >#</a
+	    ></p
+	  ><div class="doc"
+	  ><p
+	    ><code
+	      ><a href="#" title="T24294"
+		>unfoldr</a
+		></code
+	      > needs to link to local definition and not to <code
+	      ><a href="#" title="Data.List"
+		>unfoldr</a
+		></code
+	      ></p
+	    ></div
+	  ></div
+	></div
+      ></div
+    ></body
+  ></html
+>
diff --git a/html-test/src/T24294.hs b/html-test/src/T24294.hs
new file mode 100644
index 0000000000000000000000000000000000000000..c529601900a8ba2cee3534530abcb3eed78b41fe
--- /dev/null
+++ b/html-test/src/T24294.hs
@@ -0,0 +1,6 @@
+module T24294 where
+
+import qualified Data.List
+
+-- | 'unfoldr' needs to link to local definition and not to 'Data.List.unfoldr'
+unfoldr = undefined