cuelang.org/go@v0.10.1/cue/testdata/interpolation/incomplete.txtar (about)

     1  Issue #553
     2  
     3  -- in.cue --
     4  a: "foo"
     5  b: "boo"
     6  commands: {
     7  	#c: {
     8  		help: "help!"
     9  	}
    10  }
    11  out: """
    12      a is \(a)
    13      b is \(b)
    14  
    15      c is \(commands.#c.help)
    16      d is \(commands.#d.help)
    17      """
    18  -- out/eval/stats --
    19  Leaks:  0
    20  Freed:  7
    21  Reused: 3
    22  Allocs: 4
    23  Retain: 0
    24  
    25  Unifications: 7
    26  Conjuncts:    11
    27  Disjuncts:    7
    28  -- out/eval --
    29  (struct){
    30    a: (string){ "foo" }
    31    b: (string){ "boo" }
    32    commands: (struct){
    33      #c: (#struct){
    34        help: (string){ "help!" }
    35      }
    36    }
    37    out: (_|_){
    38      // [incomplete] out: invalid interpolation: undefined field: #d:
    39      //     ./in.cue:8:6
    40      //     ./in.cue:13:21
    41    }
    42  }
    43  -- out/compile --
    44  --- in.cue
    45  {
    46    a: "foo"
    47    b: "boo"
    48    commands: {
    49      #c: {
    50        help: "help!"
    51      }
    52    }
    53    out: "a is \(〈0;a〉)
    54    b is \(〈0;b〉)
    55    
    56    c is \(〈0;commands〉.#c.help)
    57    d is \(〈0;commands〉.#d.help)"
    58  }