1

I came across Swift's Never type, and the documentation gives the following hypothetical sample code:

func crashAndBurn() -> Never {
    fatalError("Something very, very bad happened")
}

I understand the concept of Never but can't really think of a practical use case in a real world application.

Does anyone have an example of how they've used Never?

XmasRights
  • 1,427
  • 13
  • 21

0 Answers0