luau
luau copied to clipboard
disallow variadic type packs in parenthesized types when in return position
This PR is a breaking change, but I doubt anyone uses the syntax.
local function a(): (string, ...number) | boolean -- valid syntax, but weird type
local function a(): (string, buffer, ...number) | boolean -- syntax error
local function a(): (...number) | boolean -- syntax error
This PR makes the first example a syntax error, which it should be.