Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined field diagnostic broken #422

Closed
ZLOY5 opened this issue Feb 24, 2021 · 1 comment
Closed

Undefined field diagnostic broken #422

ZLOY5 opened this issue Feb 24, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ZLOY5
Copy link

ZLOY5 commented Feb 24, 2021

Describe the bug
Undefined field diagnostic broken in some cases

To Reproduce
Open code in editor. If you uncomment ---@type annotation all works fine
I guess something wrong with types inference

---@class CEntityInstance
CEntityInstance = {}
---@class CBaseEntity:CEntityInstance
CBaseEntity = {}
---@class CBaseModelEntity:CBaseEntity
CBaseModelEntity = {}
---@class CBaseAnimating:CBaseModelEntity
CBaseAnimating = {}
---@class CBaseFlex:CBaseAnimating
CBaseFlex = {}
---@class CDOTA_BaseNPC:CBaseFlex
CDOTA_BaseNPC = {}

---@return string
function CDOTA_BaseNPC:GetUnitName() end

---@return number
function CDOTA_BaseNPC:GetHealth() end

---@return CDOTA_BaseNPC
function CreateTestUnit() end

-----@type CDOTA_BaseNPC
local unit = CreateTestUnit()
unit.testField = 3

if unit.testField then
	local test = unit.testField
end

Screenshots
image

Environment

  • OS: Windows 10
  • Client: VSCode
@sumneko sumneko added the bug Something isn't working label Feb 25, 2021
@sumneko sumneko closed this as completed in 39e74b5 Mar 1, 2021
@ari-party
Copy link

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants