zed
zed copied to clipboard
ZSON serializer bug for nested named types
The ZSON serializer has a bug where it thinks a named type is implied when it isn't.
Reproduce with this input:
$ echo '[1(=A),{s:"foo"(=B)}(=A)]' | zq -
[1(=A),{s:"foo"}(=A)]
Note that type B disappears even though it's properly parsed on input and in the ZNG:
$ echo '[1(=A),{s:"foo"(=B)}(=A)]' | zq 'yield typeof(this[1])' -
<A={s:B=string}>
This is likely an easy fix in the implied type logic of an array of union.