 
 extension Dictionary : Encodable /* where Key : Encodable, Value : Encodable */ {
     public func encode(to encoder: Encoder) throws {
-        guard Key.self is Encodable.Type else {
-            preconditionFailure("\(type(of: self)) does not conform to Encodable because \(Key.self) does not conform to Encodable.")
-        }
-
-        guard Value.self is Encodable.Type else {
-            preconditionFailure("\(type(of: self)) does not conform to Encodable because \(Value.self) does not conform to Encodable.")
-        }
+        assertTypeIsEncodable(Key.self, in: type(of: self))
+        assertTypeIsEncodable(Value.self, in: type(of: self))
 
         if Key.self == String.self {
             // Since the keys are already Strings, we can use them as keys directly.


extension Array : Decodable /* where Element : Decodable */ {
    public init(from decoder: Decoder) throws {
        // Initialize self here so we can print type(of: self).
        self.init()

        guard Element.self is Decodable.Type else {
            preconditionFailure("\(type(of: self)) does not conform to Decodable because \(Element.self) does not conform to Decodable.")
        }

        let metaType = (Element.self as! Decodable.Type)
        var container = try decoder.unkeyedContainer()


extension Set : Encodable /* where Element : Encodable */ {
    public func encode(to encoder: Encoder) throws {
        assertTypeIsEncodable(Element.self, in: type(of: self))

        var container = encoder.unkeyedContainer()
        for element in self {
