cuelang.org/go@v0.10.1/cue/testdata/interpolation/041_interpolation.txtar (about) 1 # DO NOT EDIT; generated by go run testdata/gen.go 2 # 3 #name: interpolation 4 #evalPartial 5 -- in.cue -- 6 a: "\(4)" 7 b: "one \(a) two \( a+c )" 8 c: "one" 9 d: "\(r)" 10 u: "\(_)" 11 r: _ 12 e: "\([])" 13 -- out/def -- 14 a: "4" 15 b: "one 4 two 4one" 16 c: "one" 17 d: "\(r)" 18 r: _ 19 u: "\(_)" 20 e: _|_ // 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 -- 35 Leaks: 1 36 Freed: 8 37 Reused: 6 38 Allocs: 3 39 Retain: 12 40 41 Unifications: 9 42 Conjuncts: 16 43 Disjuncts: 19 44 -- out/eval -- 45 Errors: 46 e: invalid interpolation: cannot use [] (type list) as type (bool|string|bytes|number): 47 ./in.cue:7:4 48 ./in.cue:7:7 49 50 Result: 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 }