cuelang.org/go@v0.13.0/cue/testdata/disjunctions/issue3850.txtar (about)

     1  -- issue3850.cue --
     2  issue3850: full: {
     3  	global: glb1: glb2: "123"
     4  	out: {foo?: _} | {}
     5  	out: {foo?: _} | {}
     6  	out: #WithFoo
     7  
     8  	#WithFoo: {
     9  		_global: global
    10  		foo: _global.glb1.glb2
    11  	}
    12  }
    13  issue3850: incomplete: {
    14  	global: glb1: glb2: "123"
    15  	out: {foo?: _} | {}
    16  	out: {foo?: _} | {}
    17  	out: #WithFoo
    18  
    19  	#WithFoo: {
    20  		_global: global
    21  		foo: _global.glb1.glb2
    22  		...
    23  	}
    24  }
    25  issue3850: p2p: {
    26  	out: *{} | _
    27  	out: *{} | _
    28  	out: {
    29  		reg: #def
    30  		#def: foo: _global
    31  	}
    32  
    33  	_global: "global value"
    34  }
    35  -- issue3875.cue --
    36  issue3875: full: {
    37  	_global: name: "foo"
    38  
    39  	out: desc: {
    40  		_hidden: _global.name
    41  		name: _hidden
    42  	}
    43  	out: #Schema | "never"
    44  
    45  	#Schema: desc: {...}
    46  }
    47  issue3875: reduced: {
    48  	global: a: "foo"
    49  
    50  	out: desc: {
    51  		a: b
    52  		b: global.a
    53  	}
    54  	out: S | null
    55  
    56  	S: {}
    57  }
    58  -- out/evalalpha/stats --
    59  Leaks:  142
    60  Freed:  0
    61  Reused: 0
    62  Allocs: 142
    63  Retain: 0
    64  
    65  Unifications: 66
    66  Conjuncts:    131
    67  Disjuncts:    22
    68  
    69  CloseIDElems: 58
    70  NumCloseIDs: 24
    71  -- diff/-out/evalalpha/stats<==>+out/eval/stats --
    72  diff old new
    73  --- old
    74  +++ new
    75  @@ -1,9 +1,12 @@
    76  -Leaks:  0
    77  -Freed:  113
    78  -Reused: 102
    79  -Allocs: 11
    80  -Retain: 18
    81  -
    82  -Unifications: 97
    83  -Conjuncts:    182
    84  -Disjuncts:    123
    85  +Leaks:  142
    86  +Freed:  0
    87  +Reused: 0
    88  +Allocs: 142
    89  +Retain: 0
    90  +
    91  +Unifications: 66
    92  +Conjuncts:    131
    93  +Disjuncts:    22
    94  +
    95  +CloseIDElems: 58
    96  +NumCloseIDs: 24
    97  -- out/eval/stats --
    98  Leaks:  0
    99  Freed:  113
   100  Reused: 102
   101  Allocs: 11
   102  Retain: 18
   103  
   104  Unifications: 97
   105  Conjuncts:    182
   106  Disjuncts:    123
   107  -- out/evalalpha --
   108  (struct){
   109    issue3850: (struct){
   110      full: (struct){
   111        global: (struct){
   112          glb1: (struct){
   113            glb2: (string){ "123" }
   114          }
   115        }
   116        out: (#struct){
   117          _global: (#struct){
   118            glb1: (#struct){
   119              glb2: (string){ "123" }
   120            }
   121          }
   122          foo: (string){ "123" }
   123        }
   124        #WithFoo: (#struct){
   125          _global: (#struct){
   126            glb1: (#struct){
   127              glb2: (string){ "123" }
   128            }
   129          }
   130          foo: (string){ "123" }
   131        }
   132      }
   133      incomplete: (struct){
   134        global: (struct){
   135          glb1: (struct){
   136            glb2: (string){ "123" }
   137          }
   138        }
   139        out: (#struct){
   140          _global: (#struct){
   141            glb1: (#struct){
   142              glb2: (string){ "123" }
   143            }
   144          }
   145          foo: (string){ "123" }
   146        }
   147        #WithFoo: (#struct){
   148          _global: (#struct){
   149            glb1: (#struct){
   150              glb2: (string){ "123" }
   151            }
   152          }
   153          foo: (string){ "123" }
   154        }
   155      }
   156      p2p: (struct){
   157        out: (struct){
   158          reg: ~(issue3850.p2p.out.#def)
   159          #def: (#struct){
   160            foo: (string){ "global value" }
   161          }
   162        }
   163        _global: (string){ "global value" }
   164      }
   165    }
   166    issue3875: (struct){
   167      full: (struct){
   168        _global: (struct){
   169          name: (string){ "foo" }
   170        }
   171        out: (#struct){
   172          desc: (#struct){
   173            _hidden: (string){ "foo" }
   174            name: (string){ "foo" }
   175          }
   176        }
   177        #Schema: (#struct){
   178          desc: (#struct){
   179          }
   180        }
   181      }
   182      reduced: (struct){
   183        global: (struct){
   184          a: (string){ "foo" }
   185        }
   186        out: (struct){
   187          desc: (struct){
   188            a: (string){ "foo" }
   189            b: (string){ "foo" }
   190          }
   191        }
   192        S: (struct){
   193        }
   194      }
   195    }
   196  }
   197  -- diff/-out/evalalpha<==>+out/eval --
   198  diff old new
   199  --- old
   200  +++ new
   201  @@ -48,9 +48,7 @@
   202       }
   203       p2p: (struct){
   204         out: (struct){
   205  -        reg: (#struct){
   206  -          foo: (string){ "global value" }
   207  -        }
   208  +        reg: ~(issue3850.p2p.out.#def)
   209           #def: (#struct){
   210             foo: (string){ "global value" }
   211           }
   212  -- out/eval --
   213  (struct){
   214    issue3850: (struct){
   215      full: (struct){
   216        global: (struct){
   217          glb1: (struct){
   218            glb2: (string){ "123" }
   219          }
   220        }
   221        out: (#struct){
   222          _global: (#struct){
   223            glb1: (#struct){
   224              glb2: (string){ "123" }
   225            }
   226          }
   227          foo: (string){ "123" }
   228        }
   229        #WithFoo: (#struct){
   230          _global: (#struct){
   231            glb1: (#struct){
   232              glb2: (string){ "123" }
   233            }
   234          }
   235          foo: (string){ "123" }
   236        }
   237      }
   238      incomplete: (struct){
   239        global: (struct){
   240          glb1: (struct){
   241            glb2: (string){ "123" }
   242          }
   243        }
   244        out: (#struct){
   245          _global: (#struct){
   246            glb1: (#struct){
   247              glb2: (string){ "123" }
   248            }
   249          }
   250          foo: (string){ "123" }
   251        }
   252        #WithFoo: (#struct){
   253          _global: (#struct){
   254            glb1: (#struct){
   255              glb2: (string){ "123" }
   256            }
   257          }
   258          foo: (string){ "123" }
   259        }
   260      }
   261      p2p: (struct){
   262        out: (struct){
   263          reg: (#struct){
   264            foo: (string){ "global value" }
   265          }
   266          #def: (#struct){
   267            foo: (string){ "global value" }
   268          }
   269        }
   270        _global: (string){ "global value" }
   271      }
   272    }
   273    issue3875: (struct){
   274      full: (struct){
   275        _global: (struct){
   276          name: (string){ "foo" }
   277        }
   278        out: (#struct){
   279          desc: (#struct){
   280            _hidden: (string){ "foo" }
   281            name: (string){ "foo" }
   282          }
   283        }
   284        #Schema: (#struct){
   285          desc: (#struct){
   286          }
   287        }
   288      }
   289      reduced: (struct){
   290        global: (struct){
   291          a: (string){ "foo" }
   292        }
   293        out: (struct){
   294          desc: (struct){
   295            a: (string){ "foo" }
   296            b: (string){ "foo" }
   297          }
   298        }
   299        S: (struct){
   300        }
   301      }
   302    }
   303  }
   304  -- out/compile --
   305  --- issue3850.cue
   306  {
   307    issue3850: {
   308      full: {
   309        global: {
   310          glb1: {
   311            glb2: "123"
   312          }
   313        }
   314        out: ({
   315          foo?: _
   316        }|{})
   317        out: ({
   318          foo?: _
   319        }|{})
   320        out: 〈0;#WithFoo〉
   321        #WithFoo: {
   322          _global: 〈1;global〉
   323          foo: 〈0;_global〉.glb1.glb2
   324        }
   325      }
   326    }
   327    issue3850: {
   328      incomplete: {
   329        global: {
   330          glb1: {
   331            glb2: "123"
   332          }
   333        }
   334        out: ({
   335          foo?: _
   336        }|{})
   337        out: ({
   338          foo?: _
   339        }|{})
   340        out: 〈0;#WithFoo〉
   341        #WithFoo: {
   342          _global: 〈1;global〉
   343          foo: 〈0;_global〉.glb1.glb2
   344          ...
   345        }
   346      }
   347    }
   348    issue3850: {
   349      p2p: {
   350        out: (*{}|_)
   351        out: (*{}|_)
   352        out: {
   353          reg: 〈0;#def〉
   354          #def: {
   355            foo: 〈2;_global〉
   356          }
   357        }
   358        _global: "global value"
   359      }
   360    }
   361  }
   362  --- issue3875.cue
   363  {
   364    issue3875: {
   365      full: {
   366        _global: {
   367          name: "foo"
   368        }
   369        out: {
   370          desc: {
   371            _hidden: 〈2;_global〉.name
   372            name: 〈0;_hidden〉
   373          }
   374        }
   375        out: (〈0;#Schema〉|"never")
   376        #Schema: {
   377          desc: {
   378            ...
   379          }
   380        }
   381      }
   382    }
   383    issue3875: {
   384      reduced: {
   385        global: {
   386          a: "foo"
   387        }
   388        out: {
   389          desc: {
   390            a: 〈0;b〉
   391            b: 〈2;global〉.a
   392          }
   393        }
   394        out: (〈0;S〉|null)
   395        S: {}
   396      }
   397    }
   398  }