From 7e6a08def72e6953605f2320b90da4e78339a59a Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 17 Apr 2020 14:15:16 -0700 Subject: [PATCH] fix Delta print of Union --- src/datafmt.cpp | 3 ++- test/testtype.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/datafmt.cpp b/src/datafmt.cpp index 8844d81..88de1c9 100644 --- a/src/datafmt.cpp +++ b/src/datafmt.cpp @@ -16,7 +16,7 @@ struct FmtDelta { void field(const std::string& prefix, const Value& val, bool verytop) { - if(!val.isMarked(true,false)) + if(verytop && !val.isMarked()) return; strm<members.size())) { if(udesc == &desc->members[idx]) { cprefix+=desc->miter[idx].first; + break; } } } diff --git a/test/testtype.cpp b/test/testtype.cpp index 31797cf..d2def22 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -416,6 +416,7 @@ void testFormat() "array.choice[0]->one int32_t = 1357\n" "array.choice[1] null\n" "array.choice[2] union\n" + "array.choice[2]->two struct\n" "array.choice[2]->two.ahalf int32_t = 2468\n" "array.more struct[] = {\?}[]\n" );