internal/core/eval: verify issue 306 is fixed

Change-Id: Ie54471b0d2459831c52e2ca53c4a648f6510cd3a
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6944
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/testdata/cycle/issue306.txtar b/cue/testdata/cycle/issue306.txtar
new file mode 100644
index 0000000..a83b30f
--- /dev/null
+++ b/cue/testdata/cycle/issue306.txtar
@@ -0,0 +1,38 @@
+-- in.cue --
+a: 12
+#Controller: settings: {
+    controller: #Controller
+}
+
+-- out/eval --
+Errors:
+#Controller.settings.controller: structural cycle
+
+Result:
+(_|_){
+  // [structural cycle]
+  a: (int){ 12 }
+  #Controller: (_|_){
+    // [structural cycle]
+    settings: (_|_){
+      // [structural cycle]
+      controller: (_|_){
+        // [structural cycle] #Controller.settings.controller: structural cycle
+        settings: (_|_){// {
+          //   controller: 〈2;#Controller〉
+          // }
+        }
+      }
+    }
+  }
+}
+-- out/compile --
+--- in.cue
+{
+  a: 12
+  #Controller: {
+    settings: {
+      controller: 〈2;#Controller〉
+    }
+  }
+}