-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
This implementation currently cannot be called by tests:
swift-webpush/Sources/WebPush/Push Message/Notification.swift
Lines 584 to 589 in 70e9c03
| #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) | |
| extension Never: @retroactive Codable { | |
| /// A default implementation for Never for macOS 13, since official support was added in macOS 14. | |
| /// | |
| /// - SeeAlso: https://github.com/swiftlang/swift/blob/af3e7e765549c0397288e60983c96d81639287ed/stdlib/public/core/Policy.swift#L81-L86 | |
| public func encode(to encoder: any Encoder) throws {} |
An attempt was made in dimitri/never-tests:
swift-webpush/Tests/WebPushTests/NeverTests.swift
Lines 20 to 40 in 52e080d
| // struct CustomEncoder: Encoder { | |
| // var codingPath: [any CodingKey] = [] | |
| // var userInfo: [CodingUserInfoKey : Any] = [:] | |
| // | |
| // func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> where Key : CodingKey { | |
| // fatalError() | |
| // } | |
| // | |
| // func unkeyedContainer() -> any UnkeyedEncodingContainer { | |
| // fatalError() | |
| // } | |
| // | |
| // func singleValueContainer() -> any SingleValueEncodingContainer { | |
| // fatalError() | |
| // } | |
| // } | |
| // | |
| // struct DummyNever: Encodable {} | |
| // | |
| // let encodeFunction = unsafeBitCast(Never.encode, to: type(of: DummyNever.encode)) | |
| // try encodeFunction(DummyNever())(CustomEncoder()) |
Metadata
Metadata
Assignees
Labels
No labels