Interesting that C++ can do this but not Swift.
I just tracked the 10x slowdown in my barebones codable implementation because of this feature; put a workaround and now it's just one order of magnitude slower than the manual serialiser instead of two.