Index: tests/.expect/poly-self-cycle.txt
===================================================================
--- tests/.expect/poly-self-cycle.txt	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
+++ tests/.expect/poly-self-cycle.txt	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
@@ -0,0 +1,1 @@
+done!
Index: tests/include/includes.cfa
===================================================================
--- tests/include/includes.cfa	(revision 6cb3e5d030ef6b97c76025688d3dd332f40403cd)
+++ tests/include/includes.cfa	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 22 10:16:58 2023
-// Update Count     : 811
+// Last Modified On : Thu Mar 13 11:56:08 2025
+// Update Count     : 831
 //
 
@@ -63,5 +63,4 @@
 #include <ftw.h>
 #include <sys/types.h>
-//#include <gawkapi.h>									// CFA bug #240 nested anonymous enum fails
 #include <gconv.h>
 #include <getopt.h>
@@ -72,5 +71,5 @@
 #include <gshadow.h>
 #include <iconv.h>
-//#include <ifaddrs.h>									// causes warning messages that break the build
+#include <ifaddrs.h>
 #include <inttypes.h>
 #include <langinfo.h>
@@ -79,5 +78,5 @@
 #include <libintl.h>
 #include <limits.h>
-//#include <link.h>										// CFA bug #240 nested anonymous enum fails
+#include <link.h>
 #include <locale.h>
 #if __has_include( "ltdl.h" )
@@ -97,5 +96,5 @@
 #include <ncurses_dll.h>								// may not be installed, comes with ncurses
 #endif
-//#include <netdb.h>
+#include <netdb.h>
 #include <nl_types.h>
 #include <nss.h>
@@ -111,5 +110,5 @@
 #include <pwd.h>
 #include <regex.h>
-//#include <resolv.h>
+#include <resolv.h>
 #include <re_comp.h>
 #include <sched.h>
@@ -125,4 +124,7 @@
 #include <stdint.h>
 #include <stdio.h>
+#if __has_include( "gawkapi.h" )
+#include <gawkapi.h>									// requires stdio.h, so appears after it
+#endif
 #include <stdio_ext.h>
 #include <stdlib.h>
@@ -140,7 +142,7 @@
 #include <termio.h>
 #include <termios.h>
-// #include <term_entry.h>								// conflicts with search.h on some machines
+#include <term_entry.h>
 #include <tgmath.h>
-//#include <threads.h>									// does not exist
+#include <threads.h>									// does not exist
 #include <thread_db.h>
 #include <time.h>
Index: tests/poly-self-cycle.cfa
===================================================================
--- tests/poly-self-cycle.cfa	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
+++ tests/poly-self-cycle.cfa	(revision e48aca8ae51f025285f95f19f58f543a0bfdec0b)
@@ -0,0 +1,38 @@
+// Make sure that self references in polymorphic types do not cause issues.
+
+forall(T)
+struct TreeNodeO {
+	T data;
+	TreeNodeO(T) * left;
+	TreeNodeO(T) * right;
+};
+
+forall(T &)
+struct TreeNodeD {
+	T * data;
+	TreeNodeD(T) * left;
+	TreeNodeD(T) * right;
+};
+
+// Instantiate the two types in different ways.
+forall(U)
+void tree_node(TreeNodeO(U) & this) {
+	TreeNodeO(U) local;
+	local.left = &this;
+}
+
+forall(U)
+void tree_node(TreeNodeD(U) & this) {
+	TreeNodeD(U) local;
+	local.left = &this;
+}
+
+int main() {
+	TreeNodeO(int) node0;
+	tree_node(node0);
+	TreeNodeD(int) node1;
+	tree_node(node1);
+
+	// There is nothing interesting to print, so just print some noise.
+	printf("done!\n");
+}
