github.com/solo-io/cue@v0.4.7/doc/tutorial/basics/4_references/30_aliases.txt (about)

     1  cue eval alias.cue
     2  cmp stdout expect-stdout-cue
     3  
     4  -- frontmatter.toml --
     5  title = "Aliases"
     6  description = ""
     7  
     8  -- text.md --
     9  An alias defines a local macro.
    10  
    11  A typical use case is to provide access to a shadowed field.
    12  
    13  Aliases are not members of a struct. They can be referred to only within the
    14  struct, and they do not appear in the output.
    15  
    16  -- alias.cue --
    17  let A = a  // A is an alias for a
    18  a: {
    19      d: 3
    20  }
    21  b: {
    22      a: {
    23          // A provides access to the outer "a" which would
    24          // otherwise be hidden by the inner one.
    25          c: A.d
    26      }
    27  }
    28  
    29  -- expect-stdout-cue --
    30  a: {
    31      d: 3
    32  }
    33  b: {
    34      a: {
    35          c: 3
    36      }
    37  }