Skip to content

Incorrect type signature on assert #1476

Closed
@stellartux

Description

@stellartux

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Type Checking, Diagnostics/Syntax Checking

Expected Behaviour

The assert function takes any number of arguments and returns all of its arguments.

local x, y, z = assert(1, 2, 3)

The type hints for x, y and z should all be integer. None of the parameters of assert are redundant.

Actual Behaviour

The type hinting shows assert returning only a single argument. The type hint for x is integer, y and z have nil. The third parameter is highlighted as redundant.

Reproduction steps

Enter the following code in the editor.

local x, y, z = assert(1, 2, 3)

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions