<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/fatalError(_:file:line:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s10fatalError_4file4lines5NeverOSSyXK_s12StaticStringVSutF"
  },
  "title" : "fatalError(_:file:line:)"
}
-->

# fatalError(_:file:line:)

Unconditionally prints a given message and stops execution.

```
func fatalError(_ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line) -> Never
```

## Parameters

`message`

The string to print. The default is an empty string.

`file`

The file name to print with `message`. The default is the file
where `fatalError(_:file:line:)` is called.

`line`

The line number to print along with `message`. The default is the
line number where `fatalError(_:file:line:)` is called.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)