cuelang.org/go@v0.10.1/cue/testdata/scalars/yield.txtar (about)

     1  // Issue #729
     2  -- in.cue --
     3  ifScalar: {
     4  	_#cond: true
     5  
     6  	if _#cond {5}
     7  }
     8  
     9  ifScalarConflict: {
    10  	_#cond: true
    11  
    12  	if _#cond {5}
    13  
    14  	"soo"
    15  }
    16  
    17  ifScalarNested: {
    18  	_#cond: true
    19  
    20  	if _#cond {{{5}}}
    21  
    22  }
    23  -- out/eval/stats --
    24  Leaks:  0
    25  Freed:  7
    26  Reused: 4
    27  Allocs: 3
    28  Retain: 3
    29  
    30  Unifications: 7
    31  Conjuncts:    13
    32  Disjuncts:    7
    33  -- out/evalalpha --
    34  Errors:
    35  ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    36      ./in.cue:10:13
    37      ./in.cue:12:2
    38  
    39  Result:
    40  (_|_){
    41    // [eval]
    42    ifScalar: (int){
    43      5
    44      _#cond: (bool){ true }
    45    }
    46    ifScalarConflict: (_|_){
    47      // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    48      //     ./in.cue:10:13
    49      //     ./in.cue:12:2
    50      _#cond: (bool){ true }
    51    }
    52    ifScalarNested: (int){
    53      5
    54      _#cond: (bool){ true }
    55    }
    56  }
    57  -- diff/-out/evalalpha<==>+out/eval --
    58  diff old new
    59  --- old
    60  +++ new
    61  @@ -1,6 +1,5 @@
    62   Errors:
    63   ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    64  -    ./in.cue:10:2
    65       ./in.cue:10:13
    66       ./in.cue:12:2
    67   
    68  @@ -13,7 +12,6 @@
    69     }
    70     ifScalarConflict: (_|_){
    71       // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    72  -    //     ./in.cue:10:2
    73       //     ./in.cue:10:13
    74       //     ./in.cue:12:2
    75       _#cond: (bool){ true }
    76  -- diff/todo/p2 --
    77  Missing error positions
    78  -- out/eval --
    79  Errors:
    80  ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    81      ./in.cue:10:2
    82      ./in.cue:10:13
    83      ./in.cue:12:2
    84  
    85  Result:
    86  (_|_){
    87    // [eval]
    88    ifScalar: (int){
    89      5
    90      _#cond: (bool){ true }
    91    }
    92    ifScalarConflict: (_|_){
    93      // [eval] ifScalarConflict: conflicting values "soo" and 5 (mismatched types string and int):
    94      //     ./in.cue:10:2
    95      //     ./in.cue:10:13
    96      //     ./in.cue:12:2
    97      _#cond: (bool){ true }
    98    }
    99    ifScalarNested: (int){
   100      5
   101      _#cond: (bool){ true }
   102    }
   103  }
   104  -- out/compile --
   105  --- in.cue
   106  {
   107    ifScalar: {
   108      _#cond: true
   109      if 〈0;_#cond〉 {
   110        5
   111      }
   112    }
   113    ifScalarConflict: {
   114      _#cond: true
   115      if 〈0;_#cond〉 {
   116        5
   117      }
   118      "soo"
   119    }
   120    ifScalarNested: {
   121      _#cond: true
   122      if 〈0;_#cond〉 {
   123        {
   124          {
   125            5
   126          }
   127        }
   128      }
   129    }
   130  }