> ## Documentation Index
> Fetch the complete documentation index at: https://gluals.arnux.net/llms.txt
> Use this file to discover all available pages before exploring further.

# @return_alias

> Mark a function that returns one of its arguments unchanged.

> [!NOTE]
>
> This annotation is intended for complex cases and is primarily designed to be used by the built-in annotations.

## Overview

`return_alias` marks a function whose first return value is the same value it was given in one argument, not a copy. `assert` is one: `assert(x)` returns `x` itself.

GLuaLS then treats the result as the argument itself. Methods you add through the result go on the original.

***

## Syntax

```lua theme={null}
---@[return_alias(index)]
```

Put it after the `@return` line. `index` is the zero-based position of the returned argument.

***

## Example

The official annotations describe `assert` like this:

```lua theme={null}
---@generic T, T1
---@param expression T
---@param ... T1
---@return std.NotNull<T>, T1...
---@[return_alias(0)]
function _G.assert(expression, ...) end
```

```lua theme={null}
local PANEL = assert(FindMetaTable("Panel"))

function PANEL:FadeIn() end -- added to every Panel
```

***

## See also

* [`@copy_result`](https://gluals.arnux.net/annotations/copy-result): a function that returns a copy of its argument


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.