<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/SourceLocation/init(fileID:filePath:line:column:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing14SourceLocationV6fileID0D4Path4line6columnACSS_SSS2itcfc"
  },
  "title" : "init(fileID:filePath:line:column:)"
}
-->

# init(fileID:filePath:line:column:)

Initialize an instance of this type with the specified location details.

```
init(fileID: String, filePath: String, line: Int, column: Int)
```

## Parameters

`fileID`

The file ID of the source file, using the format described in
the documentation for the
[`#fileID`](https://developer.apple.com/documentation/swift/fileID())
macro in the Swift standard library.

`filePath`

The path to the source file.

`line`

The line in the source file. Must be greater than `0`.

`column`

The column in the source file. Must be greater than `0`.

## Discussion> Precondition: `fileID` must not be empty and must be formatted as
> described in the documentation for
> [`#fileID`](https://developer.apple.com/documentation/swift/fileID()).

> Precondition: `line` must be greater than `0`.

> Precondition: `column` must be greater than `0`.

---

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)