Skip to content

Instantly share code, notes, and snippets.

@KaQuMiQ
Created February 23, 2021 13:33
Show Gist options
  • Select an option

  • Save KaQuMiQ/8a0070115f355b18b36108a2d8aee375 to your computer and use it in GitHub Desktop.

Select an option

Save KaQuMiQ/8a0070115f355b18b36108a2d8aee375 to your computer and use it in GitHub Desktop.
Function placeholders
func placeholder<R>(_ message: String = "Unimplemented") -> () -> R {
{ fatalError(message) }
}
func placeholder<A1, R>(_ message: String = "Unimplemented") -> (A1) -> R {
{ _ in fatalError(message) }
}
func placeholder<A1, A2, R>(_ message: String = "Unimplemented") -> (A1, A2) -> R {
{ _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, R>(_ message: String = "Unimplemented") -> (A1, A2, A3) -> R {
{ _, _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, A4, R>(_ message: String = "Unimplemented") -> (A1, A2, A3, A4) -> R {
{ _, _, _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, A4, A5, R>(_ message: String = "Unimplemented") -> (A1, A2, A3, A4, A5) -> R {
{ _, _, _, _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, A4, A5, A6, R>(_ message: String = "Unimplemented") -> (A1, A2, A3, A4, A5, A6) -> R {
{ _, _, _, _, _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, A4, A5, A6, A7, R>(_ message: String = "Unimplemented") -> (A1, A2, A3, A4, A5, A6, A7) -> R {
{ _, _, _, _, _, _, _ in fatalError(message) }
}
func placeholder<A1, A2, A3, A4, A5, A6, A7, A8, R>(_ message: String = "Unimplemented") -> (A1, A2, A3, A4, A5, A6, A7, A8) -> R {
{ _, _, _, _, _, _, _, _ in fatalError(message) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment