Skip to content

For loop with negative step: false positive #2973

@girvel

Description

@girvel

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Windows WSL

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

Warning shouldn't be displayed

Actual Behaviour

Warning is displayed

Reproduction steps

local r = 1
for x = -r, 1 do
  print(x)
end

Additional Notes

Tested on 3.13.2.
image

Log File

I am using nvim + mason, and it does not save any logs even with command line arguments.

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