diff options
-rw-r--r-- | script/core/infer.lua | 3 | ||||
-rw-r--r-- | test/hover/init.lua | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/script/core/infer.lua b/script/core/infer.lua index 5bf8a5f2..8ac585f4 100644 --- a/script/core/infer.lua +++ b/script/core/infer.lua @@ -672,7 +672,8 @@ function m.getClass(source) end end local view = m.viewInfers(infers) - if view == 'any' then + if view == 'any' + or view == 'nil' then return nil end return view diff --git a/test/hover/init.lua b/test/hover/init.lua index 4f339c87..9dc9a9a8 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1671,3 +1671,11 @@ function f1.f2.<?f3?>() end [[ function f1.f2.f3() ]] + +TEST [[ +local t = nil +t.<?x?>() +]] +[[ +field t.x: any +]] |