-- in.cue --
_schema // embed schema through indirections
_schema: #Schema
#Schema: a?: b?: string
a: b: "foo"
c: "foo"


x: {
	_schema // embed schema through indirections
	_schema: #Schema
	#Schema: a?: b?: string
	a: b: "foo"
	c: "foo"
}
-- out/eval/stats --
Leaks:  0
Freed:  20
Reused: 14
Allocs: 6
Retain: 6

Unifications: 20
Conjuncts:    34
Disjuncts:    26
-- out/evalalpha --
(#struct){
  _schema: ~(#Schema)
  #Schema: (#struct){
    a?: (#struct){
      b?: (string){ string }
    }
  }
  a: (#struct){
    b: (string){ "foo" }
  }
  c: (string){ "foo" }
  x: (#struct){
    _schema: ~(x.#Schema)
    #Schema: (#struct){
      a?: (#struct){
        b?: (string){ string }
      }
    }
    a: (#struct){
      b: (string){ "foo" }
    }
    c: (string){ "foo" }
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -1,9 +1,5 @@
 (#struct){
-  _schema: (#struct){
-    a?: (#struct){
-      b?: (string){ string }
-    }
-  }
+  _schema: ~(#Schema)
   #Schema: (#struct){
     a?: (#struct){
       b?: (string){ string }
@@ -14,11 +10,7 @@
   }
   c: (string){ "foo" }
   x: (#struct){
-    _schema: (#struct){
-      a?: (#struct){
-        b?: (string){ string }
-      }
-    }
+    _schema: ~(x.#Schema)
     #Schema: (#struct){
       a?: (#struct){
         b?: (string){ string }
-- out/eval --
(#struct){
  _schema: (#struct){
    a?: (#struct){
      b?: (string){ string }
    }
  }
  #Schema: (#struct){
    a?: (#struct){
      b?: (string){ string }
    }
  }
  a: (#struct){
    b: (string){ "foo" }
  }
  c: (string){ "foo" }
  x: (#struct){
    _schema: (#struct){
      a?: (#struct){
        b?: (string){ string }
      }
    }
    #Schema: (#struct){
      a?: (#struct){
        b?: (string){ string }
      }
    }
    a: (#struct){
      b: (string){ "foo" }
    }
    c: (string){ "foo" }
  }
}
-- out/compile --
--- in.cue
{
  〈0;_schema〉
  _schema: 〈0;#Schema〉
  #Schema: {
    a?: {
      b?: string
    }
  }
  a: {
    b: "foo"
  }
  c: "foo"
  x: {
    〈0;_schema〉
    _schema: 〈0;#Schema〉
    #Schema: {
      a?: {
        b?: string
      }
    }
    a: {
      b: "foo"
    }
    c: "foo"
  }
}
