Skip to content

auto [a, b] =

Concurrency / multiple returns

Unpack multiple return values. The usual pairing with pcall.

auto [a, b] = expr;

None.

Each name is a local.

local a, b = expr

Not structured bindings for structs. Not auto [x, y] on a table field unpack unless expr returns multiple values.

auto [success, result] = pcall(func () {
return DataStore.GetAsync("PlayerData");
});

Emits:

local success, result = pcall(function()
return DataStore:GetAsync("PlayerData")
end)

pcall · auto