diff options
-rw-r--r-- | script/core/diagnostics/duplicate-set-field.lua | 7 | ||||
-rw-r--r-- | test/diagnostics/init.lua | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/script/core/diagnostics/duplicate-set-field.lua b/script/core/diagnostics/duplicate-set-field.lua index bf7fd069..7c857a51 100644 --- a/script/core/diagnostics/duplicate-set-field.lua +++ b/script/core/diagnostics/duplicate-set-field.lua @@ -30,6 +30,13 @@ return function (uri, callback) if not name then goto CONTINUE end + local value = guide.getObjectValue(nxt) + if value then + if value.type == 'boolean' + or value.type == 'nil' then + goto CONTINUE + end + end if not sets[name] then sets[name] = {} end diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 00752c42..6563371d 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -1031,3 +1031,21 @@ end return m ]] + +TEST [[ +local m = {} + +m.x = true +m.x = false + +return m +]] + +TEST [[ +local m = {} + +m.x = io.open() +m.x = nil + +return m +]] |