From 97d77e871b4ecadf634b9f752bbf228a622d7067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 18 Aug 2018 20:54:40 +0200 Subject: [PATCH] internal documentation --- GRDB/Record/PersistableRecord+Encodable.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GRDB/Record/PersistableRecord+Encodable.swift b/GRDB/Record/PersistableRecord+Encodable.swift index 9d4dcf890..0eb3fe01b 100644 --- a/GRDB/Record/PersistableRecord+Encodable.swift +++ b/GRDB/Record/PersistableRecord+Encodable.swift @@ -23,6 +23,17 @@ private class RecordEncoder: Encoder { } func singleValueContainer() -> SingleValueEncodingContainer { + // @itaiferber on https://forums.swift.org/t/how-to-encode-objects-of-unknown-type/12253/11 + // + // > Encoding a value into a single-value container is equivalent to + // > encoding the value directly into the encoder, with the primary + // > difference being the above: encoding into the encoder writes the + // > contents of a type into the encoder, while encoding to a + // > single-value container gives the encoder a chance to intercept the + // > type as a whole. + // + // Wait for somebody hitting this fatal error so that we can write a + // meaningful regression test. fatalError("single value encoding is not supported") }