zed icon indicating copy to clipboard operation
zed copied to clipboard

ZSON serializer bug for nested named types

Open mccanne opened this issue 2 years ago • 0 comments

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.

mccanne avatar Dec 24 '23 14:12 mccanne