-
-
Notifications
You must be signed in to change notification settings - Fork 384
Description
Describe the bug
With a variable or function parameter that has been given typing info to be a "string", undefined field warnings show for any field access on that variable/paremter.
I have been unable to find a test case with other built-in types, but it works as expected for custom types
To Reproduce
Steps to reproduce the behavior:
- In code, access any field on a "string" typed variable
- "Undefined field" warning will show up on that field
Code shown in below screenshot
---@type string
local strTyped
print(strTyped:lower())
print(strTyped:len())
print(strTyped.upper(strTyped))
-- Working as expected
local strInferred = "Foo"
print(strInferred:lower())
print(strInferred:len())
print(strInferred.upper(strInferred))
Expected behavior
"Undefined field" to not show up on "string" typed variable fields that do exist.
Environment (please complete the following information):
- OS: Windows
- Client: VSCode
Additional context
This is using the new 2.0.0 version of the extension.
Provide logs
https://pastebin.com/8s8sNPJC
There seems to be 2 of the same erros in the log that could be related at lines 3392 and 3589
Apologies for the long log file...