cuelang.org/go@v0.13.0/cue/testdata/definitions/root4.txtar (about)

     1  -- in.cue --
     2  #schema: a!: bool
     3  _hidden & #schema // must fail here, but not elsewhere
     4  _hidden: {
     5  	"a": true,
     6  	notAllowed: true
     7  }
     8  allowed: true
     9  -- out/eval/stats --
    10  Leaks:  0
    11  Freed:  9
    12  Reused: 5
    13  Allocs: 4
    14  Retain: 2
    15  
    16  Unifications: 9
    17  Conjuncts:    15
    18  Disjuncts:    11
    19  -- out/evalalpha --
    20  Errors:
    21  notAllowed: field not allowed:
    22      ./in.cue:5:2
    23  
    24  Result:
    25  (_|_){
    26    // [eval]
    27    #schema: (#struct){
    28      a!: (bool){ bool }
    29    }
    30    _hidden: (struct){
    31      a: (bool){ true }
    32      notAllowed: (bool){ true }
    33    }
    34    allowed: (bool){ true }
    35    a: (bool){ true }
    36    notAllowed: (_|_){
    37      // [eval] notAllowed: field not allowed:
    38      //     ./in.cue:5:2
    39    }
    40  }
    41  -- diff/-out/evalalpha<==>+out/eval --
    42  diff old new
    43  --- old
    44  +++ new
    45  @@ -1,9 +1,5 @@
    46   Errors:
    47   notAllowed: field not allowed:
    48  -    ./in.cue:1:1
    49  -    ./in.cue:1:10
    50  -    ./in.cue:2:1
    51  -    ./in.cue:2:11
    52       ./in.cue:5:2
    53   
    54   Result:
    55  @@ -12,18 +8,14 @@
    56     #schema: (#struct){
    57       a!: (bool){ bool }
    58     }
    59  -  a: (bool){ true }
    60     _hidden: (struct){
    61       a: (bool){ true }
    62       notAllowed: (bool){ true }
    63     }
    64     allowed: (bool){ true }
    65  +  a: (bool){ true }
    66     notAllowed: (_|_){
    67       // [eval] notAllowed: field not allowed:
    68  -    //     ./in.cue:1:1
    69  -    //     ./in.cue:1:10
    70  -    //     ./in.cue:2:1
    71  -    //     ./in.cue:2:11
    72       //     ./in.cue:5:2
    73     }
    74   }
    75  -- out/eval --
    76  Errors:
    77  notAllowed: field not allowed:
    78      ./in.cue:1:1
    79      ./in.cue:1:10
    80      ./in.cue:2:1
    81      ./in.cue:2:11
    82      ./in.cue:5:2
    83  
    84  Result:
    85  (_|_){
    86    // [eval]
    87    #schema: (#struct){
    88      a!: (bool){ bool }
    89    }
    90    a: (bool){ true }
    91    _hidden: (struct){
    92      a: (bool){ true }
    93      notAllowed: (bool){ true }
    94    }
    95    allowed: (bool){ true }
    96    notAllowed: (_|_){
    97      // [eval] notAllowed: field not allowed:
    98      //     ./in.cue:1:1
    99      //     ./in.cue:1:10
   100      //     ./in.cue:2:1
   101      //     ./in.cue:2:11
   102      //     ./in.cue:5:2
   103    }
   104  }
   105  -- out/compile --
   106  --- in.cue
   107  {
   108    #schema: {
   109      a!: bool
   110    }
   111    (〈0;_hidden〉 & 〈0;#schema〉)
   112    _hidden: {
   113      a: true
   114      notAllowed: true
   115    }
   116    allowed: true
   117  }