github.com/solo-io/cue@v0.4.7/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: continue recursive closing for optionals
     4  #evalFull
     5  -- in.cue --
     6  #S: {
     7  	[string]: {a: int}
     8  }
     9  a: #S & {
    10  	v: {b: int}
    11  }
    12  -- out/def --
    13  #S: {
    14  	[string]: {
    15  		a: int
    16  	}
    17  }
    18  a: #S & {
    19  	v: {
    20  		b: int
    21  	}
    22  }
    23  -- out/legacy-debug --
    24  <0>{#S: <1>{[]: <2>(_: string)-><3>C{a: int}, }, a: <4>{[]: <5>(_: string)-><6>C{a: int}, v: _|_(int:field "b" not allowed in closed struct)}}
    25  -- out/compile --
    26  --- in.cue
    27  {
    28    #S: {
    29      [string]: {
    30        a: int
    31      }
    32    }
    33    a: (〈0;#S〉 & {
    34      v: {
    35        b: int
    36      }
    37    })
    38  }
    39  -- out/eval --
    40  Errors:
    41  a.v: field not allowed: b:
    42      ./in.cue:2:12
    43      ./in.cue:4:4
    44      ./in.cue:5:6
    45  
    46  Result:
    47  (_|_){
    48    // [eval]
    49    #S: (#struct){
    50    }
    51    a: (_|_){
    52      // [eval]
    53      v: (_|_){
    54        // [eval]
    55        b: (_|_){
    56          // [eval] a.v: field not allowed: b:
    57          //     ./in.cue:2:12
    58          //     ./in.cue:4:4
    59          //     ./in.cue:5:6
    60        }
    61        a: (int){ int }
    62      }
    63    }
    64  }