cuelang.org/go@v0.13.0/cue/testdata/builtins/issue_3567.txtar (about)

     1  -- in.cue --
     2  import "strings"
     3  a: strings.Join( [ strings.Join(["1"]), "2" ], "\n")
     4  
     5  -- out/compile --
     6  --- in.cue
     7  {
     8    a: 〈import;strings〉.Join([
     9      〈import;strings〉.Join([
    10        "1",
    11      ]),
    12      "2",
    13    ], "\n")
    14  }
    15  -- out/eval/stats --
    16  Leaks:  1
    17  Freed:  5
    18  Reused: 1
    19  Allocs: 5
    20  Retain: 2
    21  
    22  Unifications: 6
    23  Conjuncts:    6
    24  Disjuncts:    7
    25  -- out/evalalpha --
    26  Errors:
    27  0: not enough arguments in call to strings.Join (have 1, want 2):
    28      ./in.cue:2:20
    29  
    30  Result:
    31  (_|_){
    32    // [eval]
    33    a: (_|_){
    34      // [eval] 0: not enough arguments in call to strings.Join (have 1, want 2):
    35      //     ./in.cue:2:20
    36    }
    37  }
    38  -- diff/-out/evalalpha<==>+out/eval --
    39  diff old new
    40  --- old
    41  +++ new
    42  @@ -1,6 +1,12 @@
    43  +Errors:
    44  +0: not enough arguments in call to strings.Join (have 1, want 2):
    45  +    ./in.cue:2:20
    46  +
    47  +Result:
    48   (_|_){
    49     // [eval]
    50     a: (_|_){
    51  -    // [eval]
    52  +    // [eval] 0: not enough arguments in call to strings.Join (have 1, want 2):
    53  +    //     ./in.cue:2:20
    54     }
    55   }
    56  -- diff/explanation --
    57  The old evaluator does not correctly handle the nested nature of calls
    58  to strings.Join, and buries the error of the missing argument in the
    59  nested call. The new evaluator handles this properly.
    60  -- out/eval --
    61  (_|_){
    62    // [eval]
    63    a: (_|_){
    64      // [eval]
    65    }
    66  }