Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore unary initializer for HTTPHeaders (#301)
Motivation: The Swift compiler seems to get very nervous when variadic inits are used for types that have constructors with optional values. In general we're not worried about breaking downstream consumers' extensions when we update our code, but in this case we break the ability to conform HTTPHeaders to ExpressibleByDictionaryLiteral, which is a bit annoying. See https://bugs.swift.org/browse/SR-7415 for more details. For 1.5.0 we should conform HTTPHeaders ourselves, but until that time we can restore anyone who was conforming HTTPHeaders to ExpressibleByDictionaryLiteral by restoring the old unary initializer and delegating it to the new one. This presents an effect that is equivalent to the old behaviour, but is new. As a side note, in general it's a bad idea to conform types that you do not own to standard library protocols. NIO reserves the right to add conformances to our types in any Semver Minor release, so having that conformance in your own code risks breakage without a Semver Major patch bump. Please be aware. Modifications: Restored the unary initializer for HTTPHeaders. Result: Less breakage, more happiness.
- Loading branch information