diff --git a/Sources/SpellbookFoundation/Types & PropertyWrappers/Closure.swift b/Sources/SpellbookFoundation/Types & PropertyWrappers/Closure.swift index c7e7ef9..6b2e8fc 100644 --- a/Sources/SpellbookFoundation/Types & PropertyWrappers/Closure.swift +++ b/Sources/SpellbookFoundation/Types & PropertyWrappers/Closure.swift @@ -32,7 +32,7 @@ public struct Closure { } public func callAsFunction(_ args: repeat each Arg) -> R where T == (repeat each Arg) { - body((repeat each args)) + body(makeTuple(repeat each args)) } } @@ -64,7 +64,7 @@ public struct ThrowingClosure { } public func callAsFunction(_ args: repeat each Arg) throws -> R where T == (repeat each Arg) { - try body((repeat each args)) + try body(makeTuple(repeat each args)) } } @@ -82,3 +82,8 @@ extension ThrowingClosure { ThrowingClosure { value in try queue.sync { try self(value) } } } } + +// Workaround to make Swift 5.9/5.10 compilers happy. +private func makeTuple(_ element: repeat each Element) -> (repeat each Element) { + (repeat each element) +}