---
title: line()
framework: swift
role: symbol
role_heading: Macro
path: swift/line()
---

# line()

Produces the line number on which it appears.

## Declaration

```swift
@freestanding(expression) macro line<T>() -> T where T : ExpressibleByIntegerLiteral
```

## Overview

Overview This macro’s value can be changed by #sourceLocation, as described in Line Control Statement in The Swift Programming Language.

## See Also

### Getting Source Location Information

- [file()](swift/file().md)
- [fileID()](swift/fileid().md)
- [filePath()](swift/filepath().md)
- [function()](swift/function().md)
- [column()](swift/column().md)
