internal/encoding/yaml: support alias to scalars as map keys
This makes the decoder follow aliases in YAML map keys.
Before this commit the decoder would outright reject these keys as
non-scalar keys. This commit adds support specifically for keys which
are aliases to scalar values. YAML also permits non-scalar keys such as
maps / sequences, but there's no equivalent for those in CUE, so we
error out.
Note that this used to work in CUE v0.8.2, before we transitioned
from our own older fork of go-yaml to yaml.v3. The minor regression in
behavior was unintentional and went unnoticed as we lacked test cases.
Fixes #3821.
Closes #3822 as merged as of commit b6c33cdd.
Signed-off-by: Omri Steiner <omri@steiners.co.il>
Change-Id: I53bfc09a40ab0a1bbfabde63db1690dbb9222584
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213252
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
authored by