Closed kostko closed 5 years ago
Ah found the issue, it was caching indeed, likely a leftover from before you refactored the API:
diff --git a/codec/helper.go b/codec/helper.go
index 40fa1ab..5dd3e41 100644
--- a/codec/helper.go
+++ b/codec/helper.go
@@ -717,7 +717,7 @@ func (x *BasicHandle) fnVia(rt reflect.Type, fs *atomicRtidFnSlice, checkExt boo
copy(sp2, sp[:idx])
copy(sp2[idx+1:], sp[idx:])
sp2[idx] = codecRtidFn{rtid, fn}
- x.rtidFns.store(sp2)
+ fs.store(sp2)
// xdebugf(">>>> adding rt: %v to rtidfns of size: %v", rt, len(sp2))
}
Great catch. Phew. Thanks.
Can you send a PR with this fix to code and tests?
Done in #302.
It seems that if you have a struct containing multiple naked interfaces, tags are not emitted at all when those interfaces are assigned different types that have extensions. If there is only a single naked interface or if both naked interfaces are assigned the same type, the test passes.
My feeling is that it seems like an issue with caching serializer functions.
Failing test case: