github.com/solo-io/cue@v0.4.7/cue/testdata/interpolation/issue487.txtar (about)

     1  -- in.cue --
     2  t1: {
     3  	#R: {
     4  		pos:  uint
     5  		name: "hello_\(pos)"
     6  	}
     7  	a: #R & {pos: 67}
     8  }
     9  t2: {
    10  	#R: {
    11  		pos:  string
    12  		name: "hello_\(pos)"
    13  	}
    14  	a: #R & {pos: "a"}
    15  }
    16  -- out/eval --
    17  (struct){
    18    t1: (struct){
    19      #R: (#struct){
    20        pos: (int){ &(>=0, int) }
    21        name: (_|_){
    22          // [incomplete] t1.#R.name: invalid interpolation: non-concrete value >=0 & int (type int):
    23          //     ./in.cue:4:9
    24        }
    25      }
    26      a: (#struct){
    27        pos: (int){ 67 }
    28        name: (string){ "hello_67" }
    29      }
    30    }
    31    t2: (struct){
    32      #R: (#struct){
    33        pos: (string){ string }
    34        name: (_|_){
    35          // [incomplete] t2.#R.name: invalid interpolation: non-concrete value string (type string):
    36          //     ./in.cue:11:9
    37        }
    38      }
    39      a: (#struct){
    40        pos: (string){ "a" }
    41        name: (string){ "hello_a" }
    42      }
    43    }
    44  }
    45  -- out/compile --
    46  --- in.cue
    47  {
    48    t1: {
    49      #R: {
    50        pos: &(int, >=0)
    51        name: "hello_\(〈0;pos〉)"
    52      }
    53      a: (〈0;#R〉 & {
    54        pos: 67
    55      })
    56    }
    57    t2: {
    58      #R: {
    59        pos: string
    60        name: "hello_\(〈0;pos〉)"
    61      }
    62      a: (〈0;#R〉 & {
    63        pos: "a"
    64      })
    65    }
    66  }