# Tests that optional nested fields within a definition unified with an open struct
# (#Root: {...}) correctly accept concrete values without "field not allowed" errors.
# https://cuelang.org/issue/483
-- in.cue --
out: {
	instance
}

instance: #Type & {
	alpha: bravo: charlie: true
}

#Type: #Root & {
	alpha?: bravo?: charlie?: bool
}
#Root: {...}
-- out/compile --
--- in.cue
{
  out: {
    〈1;instance〉
  }
  instance: (〈0;#Type〉 & {
    alpha: {
      bravo: {
        charlie: true
      }
    }
  })
  #Type: (〈0;#Root〉 & {
    alpha?: {
      bravo?: {
        charlie?: bool
      }
    }
  })
  #Root: {
    ...
  }
}
