diff options
-rw-r--r-- | script/core/hover/name.lua | 3 | ||||
-rw-r--r-- | test/hover/init.lua | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/script/core/hover/name.lua b/script/core/hover/name.lua index f8473638..59e639d6 100644 --- a/script/core/hover/name.lua +++ b/script/core/hover/name.lua @@ -20,6 +20,9 @@ local function asField(source, oop) local class if source.node.type ~= 'getglobal' then class = vm.getInfer(source.node):viewClass() + if class == 'any' then + class = nil + end end local node = class or buildName(source.node, false) diff --git a/test/hover/init.lua b/test/hover/init.lua index 46accbf7..48daf593 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1929,3 +1929,13 @@ local <?x?> [[ local x: ` x | y `|`123 ????` ]] + +TEST [[ +---@type any +local x + +print(x.<?y?>) +]] +[[ +(field) x.y: unknown +]] |