Skip to content

duplicate field error when setting a field to a function in an if/else #1794

Open
@BurninSun

Description

@BurninSun

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?

Diagnostics/Syntax Checking

Expected Behaviour

No duplicate field error

Actual Behaviour

image

  if x then
    t.s = function() return 1 end
  else
    t.s = function() return 2 end
  end

This is not a duplicate field and should not be an error

Reproduction steps

  if x then
    t.s = function() return 1 end
  else
    t.s = function() return 2 end
  end

Write that into the editor. See error as indicated above.

Additional Notes

v3.6.4

Log File

file_c%3A_Users_User_AppData_Roaming_Factorio_mods_space-exploration.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions