Skip to content

Commit

Permalink
Added compiler checks for Swift 6 specific code
Browse files Browse the repository at this point in the history
Co-authored-by: Gwendal Roué <[email protected]>
  • Loading branch information
sroebert and groue authored Jul 13, 2024
1 parent c977cb8 commit 0ae3f32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GRDB/Record/FetchableRecord+Decodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,19 @@ private struct SingleValueRowDecoder<R: FetchableRecord>: SingleValueDecodingCon
func decode(_ type: Int16.Type) throws -> Int16 { try columnDecoder.decode(type) }
func decode(_ type: Int32.Type) throws -> Int32 { try columnDecoder.decode(type) }
func decode(_ type: Int64.Type) throws -> Int64 { try columnDecoder.decode(type) }
#if compiler(>=6)
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
func decode(_ type: Int128.Type) throws -> Int128 { try columnDecoder.decode(type) }
#endif
func decode(_ type: UInt.Type) throws -> UInt { try columnDecoder.decode(type) }
func decode(_ type: UInt8.Type) throws -> UInt8 { try columnDecoder.decode(type) }
func decode(_ type: UInt16.Type) throws -> UInt16 { try columnDecoder.decode(type) }
func decode(_ type: UInt32.Type) throws -> UInt32 { try columnDecoder.decode(type) }
func decode(_ type: UInt64.Type) throws -> UInt64 { try columnDecoder.decode(type) }
#if compiler(>=6)
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
func decode(_ type: UInt128.Type) throws -> UInt128 { try columnDecoder.decode(type) }
#endif

func decode<T>(_ type: T.Type) throws -> T where T: Decodable {
if let type = T.self as? any FetchableRecord.Type {
Expand Down

0 comments on commit 0ae3f32

Please sign in to comment.