...

Text file src/cuelang.org/go/cue/testdata/interpolation/041_interpolation.txtar

Documentation: cuelang.org/go/cue/testdata/interpolation

     1# DO NOT EDIT; generated by go run testdata/gen.go
     2#
     3#name: interpolation
     4#evalPartial
     5-- in.cue --
     6a: "\(4)"
     7b: "one \(a) two \( a+c )"
     8c: "one"
     9d: "\(r)"
    10u: "\(_)"
    11r: _
    12e: "\([])"
    13-- out/def --
    14a: "4"
    15b: "one 4 two 4one"
    16c: "one"
    17d: "\(r)"
    18r: _
    19u: "\(_)"
    20e: _|_ // expression in interpolation must evaluate to a number kind or string (found list)
    21-- out/legacy-debug --
    22<0>{a: "4", b: "one 4 two 4one", c: "one", d: ""+<1>.r+"", r: _, u: ""+_+"", e: _|_([]:expression in interpolation must evaluate to a number kind or string (found list))}
    23-- out/compile --
    24--- in.cue
    25{
    26  a: "\(4)"
    27  b: "one \(〈0;a〉) two \((〈0;a〉 + 〈0;c〉))"
    28  c: "one"
    29  d: "\(〈0;r〉)"
    30  u: "\(_)"
    31  r: _
    32  e: "\([])"
    33}
    34-- out/eval/stats --
    35Leaks:  1
    36Freed:  8
    37Reused: 6
    38Allocs: 3
    39Retain: 12
    40
    41Unifications: 9
    42Conjuncts:    16
    43Disjuncts:    19
    44-- out/eval --
    45Errors:
    46e: invalid interpolation: cannot use [] (type list) as type (bool|string|bytes|number):
    47    ./in.cue:7:4
    48    ./in.cue:7:7
    49
    50Result:
    51(_|_){
    52  // [eval]
    53  a: (string){ "4" }
    54  b: (string){ "one 4 two 4one" }
    55  c: (string){ "one" }
    56  d: (_|_){
    57    // [incomplete] d: invalid interpolation: non-concrete value _ (type _):
    58    //     ./in.cue:4:4
    59  }
    60  u: (_|_){
    61    // [incomplete] u: invalid interpolation: non-concrete value _ (type _):
    62    //     ./in.cue:5:4
    63    //     ./in.cue:5:7
    64  }
    65  r: (_){ _ }
    66  e: (_|_){
    67    // [eval] e: invalid interpolation: cannot use [] (type list) as type (bool|string|bytes|number):
    68    //     ./in.cue:7:4
    69    //     ./in.cue:7:7
    70  }
    71}

View as plain text