Decoding these generally takes untrusted input, and corrupted data should be diagnosed with a throw instead of a later crash; the synthesized Decodable conformance has no means to do that for us, so we have to roll our own. It's likely that a more-thorough reworking of these is appropriate, but in the short term we can and should throw an error for the cases that our existing invariants can detect.
Decoding these generally takes untrusted input, and corrupted data should be diagnosed with a throw instead of a later crash; the synthesized Decodable conformance has no means to do that for us, so we have to roll our own. It's likely that a more-thorough reworking of these is appropriate, but in the short term we can and should throw an error for the cases that our existing invariants can detect.