cuelang.org/go@v0.13.0/cue/testdata/compile/scope.txtar (about)

     1  -- in.cue --
     2  a: {
     3  	{{
     4  		b
     5  		c
     6  		d: b
     7  		e: c
     8  	}}
     9  	c: {}
    10  }
    11  b: {
    12  
    13  }
    14  s: "foo"
    15  c: s
    16  
    17  // s is technically in a new struct here so it will have a one higher count than
    18  // the one before.
    19  d: [s]: 3
    20  
    21  e: {}
    22  e & {// Is this allowed? Probably not as per comprehension rule (ref fixes.)
    23  	e: {}
    24  }
    25  
    26  {X=["foo"]: b: X | null}
    27  {[Y="bar"]: b: Y}
    28  
    29  let B = {open: int}
    30  f: B
    31  
    32  schema: {
    33  	next: _schema_1
    34  }
    35  
    36  let _schema_1 = schema
    37  -- out/compile --
    38  --- in.cue
    39  {
    40    a: {
    41      {
    42        {
    43          〈3;b〉
    44          〈2;c〉
    45          d: 〈3;b〉
    46          e: 〈2;c〉
    47        }
    48      }
    49      c: {}
    50    }
    51    b: {}
    52    s: "foo"
    53    c: 〈0;s〉
    54    d: {
    55      [〈1;s〉]: 3
    56    }
    57    e: {}
    58    (〈0;e〉 & {
    59      e: {}
    60    })
    61    {
    62      ["foo"]: {
    63        b: (〈1;(〈0;-〉)〉|null)
    64      }
    65    }
    66    {
    67      ["bar"]: {
    68        b: 〈1;-〉
    69      }
    70    }
    71    let B#1 = {
    72      open: int
    73    }
    74    f: 〈0;let B#1〉
    75    schema: {
    76      next: 〈1;let _schema_1#2〉
    77    }
    78    let _schema_1#2 = 〈0;schema〉
    79  }
    80  -- out/evalalpha/stats --
    81  Leaks:  24
    82  Freed:  0
    83  Reused: 0
    84  Allocs: 24
    85  Retain: 0
    86  
    87  Unifications: 22
    88  Conjuncts:    39
    89  Disjuncts:    2
    90  
    91  CloseIDElems: 0
    92  NumCloseIDs: 15
    93  -- diff/-out/evalalpha/stats<==>+out/eval/stats --
    94  diff old new
    95  --- old
    96  +++ new
    97  @@ -1,9 +1,12 @@
    98  -Leaks:  2
    99  -Freed:  48
   100  -Reused: 45
   101  -Allocs: 5
   102  -Retain: 8
   103  -
   104  -Unifications: 50
   105  -Conjuncts:    102
   106  -Disjuncts:    54
   107  +Leaks:  24
   108  +Freed:  0
   109  +Reused: 0
   110  +Allocs: 24
   111  +Retain: 0
   112  +
   113  +Unifications: 22
   114  +Conjuncts:    39
   115  +Disjuncts:    2
   116  +
   117  +CloseIDElems: 0
   118  +NumCloseIDs: 15
   119  -- out/eval/stats --
   120  Leaks:  2
   121  Freed:  48
   122  Reused: 45
   123  Allocs: 5
   124  Retain: 8
   125  
   126  Unifications: 50
   127  Conjuncts:    102
   128  Disjuncts:    54
   129  -- out/evalalpha --
   130  Errors:
   131  schema.next: structural cycle
   132  
   133  Result:
   134  (_|_){
   135    // [structural cycle]
   136    a: (struct){
   137      d: (struct){
   138      }
   139      e: (struct){
   140      }
   141      c: (struct){
   142      }
   143    }
   144    b: (struct){
   145    }
   146    s: (string){ "foo" }
   147    c: (string){ "foo" }
   148    d: (struct){
   149    }
   150    e: (struct){
   151    }
   152    let B#1 = (struct){
   153      open: (int){ int }
   154    }
   155    f: (struct){
   156      open: (int){ int }
   157    }
   158    schema: (_|_){
   159      // [structural cycle]
   160      next: (_|_){
   161        // [structural cycle] schema.next: structural cycle
   162      }
   163    }
   164    let _schema_1#2 = (_|_){
   165      // [structural cycle]
   166    }
   167  }
   168  -- diff/-out/evalalpha<==>+out/eval --
   169  diff old new
   170  --- old
   171  +++ new
   172  @@ -33,7 +33,6 @@
   173       }
   174     }
   175     let _schema_1#2 = (_|_){
   176  -    // [structural cycle] _schema_1: structural cycle:
   177  -    //     ./in.cue:32:8
   178  +    // [structural cycle]
   179     }
   180   }
   181  -- diff/todo/p3 --
   182  Structural cycle reported in different location. Seems fine, as
   183  ultimately we need to print the paths of the cycle anyway.
   184  Now also reports a position.
   185  -- out/eval --
   186  Errors:
   187  schema.next: structural cycle
   188  
   189  Result:
   190  (_|_){
   191    // [structural cycle]
   192    a: (struct){
   193      d: (struct){
   194      }
   195      e: (struct){
   196      }
   197      c: (struct){
   198      }
   199    }
   200    b: (struct){
   201    }
   202    s: (string){ "foo" }
   203    c: (string){ "foo" }
   204    d: (struct){
   205    }
   206    e: (struct){
   207    }
   208    let B#1 = (struct){
   209      open: (int){ int }
   210    }
   211    f: (struct){
   212      open: (int){ int }
   213    }
   214    schema: (_|_){
   215      // [structural cycle]
   216      next: (_|_){
   217        // [structural cycle] schema.next: structural cycle
   218      }
   219    }
   220    let _schema_1#2 = (_|_){
   221      // [structural cycle] _schema_1: structural cycle:
   222      //     ./in.cue:32:8
   223    }
   224  }