Skip to content

Globals set with rawset are always parsed as a table #2863

Closed
@LJSonik

Description

@LJSonik

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?

Annotations, Type Checking

Expected Behaviour

I expect x to be parsed as an integer:

rawset(_G, "x", 42)
print(x) -- x should be parsed as integer here

Actual Behaviour

x is parsed as integer|table instead.

Reproduction steps

rawset(_G, "x", 42)
print(x) -- x is parsed as integer|table here

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions