From 11a7d832c5da0530cf7e6fca6baab4540b5ded07 Mon Sep 17 00:00:00 2001 From: Niclas Kristek Date: Mon, 5 Oct 2020 13:12:16 +0200 Subject: [PATCH 1/3] Add ExpressibleByNilLiteral constraint on OptionalProtocol Optional already implements this and this makes it possible to just write nil instead of .init(reconstructing: nil) --- Sources/Optional.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Optional.swift b/Sources/Optional.swift index 1e8584c84..530fc16db 100644 --- a/Sources/Optional.swift +++ b/Sources/Optional.swift @@ -7,7 +7,7 @@ // /// An optional protocol for use in type constraints. -public protocol OptionalProtocol { +public protocol OptionalProtocol: ExpressibleByNilLiteral { /// The type contained in the otpional. associatedtype Wrapped From c29c6b5f1e74c62c4e9927a8b2fc395cb0a72f97 Mon Sep 17 00:00:00 2001 From: Niclas Kristek Date: Mon, 5 Oct 2020 13:12:45 +0200 Subject: [PATCH 2/3] Fix typo in documentation comment --- Sources/Optional.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Optional.swift b/Sources/Optional.swift index 530fc16db..d30ba0fcf 100644 --- a/Sources/Optional.swift +++ b/Sources/Optional.swift @@ -8,7 +8,7 @@ /// An optional protocol for use in type constraints. public protocol OptionalProtocol: ExpressibleByNilLiteral { - /// The type contained in the otpional. + /// The type contained in the optional. associatedtype Wrapped init(reconstructing value: Wrapped?) From b346a977c836bcaaf9f483e5147a10ab5d7277c1 Mon Sep 17 00:00:00 2001 From: Niclas Kristek Date: Mon, 5 Oct 2020 16:24:09 +0200 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2964926a..0541e1c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # master *Please add new entries at the top.* +1. Add `ExpressibleByNilLiteral` constraint to `OptionalProtocol` (#805, kudos to @nkristek) # 6.4.0 1. Bump min. deployment target to iOS 9 when using swift packages to silence Xcode 12 warnings. Update Quick & Nibmle to the latest version when using swift packages.