Skip to content

Missing-Parameter diagnostics catches false positive #1223

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

Closed
HeeMyung opened this issue Jun 17, 2022 · 1 comment
Closed

Missing-Parameter diagnostics catches false positive #1223

HeeMyung opened this issue Jun 17, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@HeeMyung
Copy link

HeeMyung commented Jun 17, 2022

Describe the bug
the missing parameter diagnostics catches a false positive warning with non-problem code.

To Reproduce
Please look at the below
image

I've copied the exact same code for you guys who want to test it self

---@meta
---@class Foo
---@field getChild fun(self:Foo,key:string):Foo

---@class Bar

---@param f Foo
---@return Bar
function toBar(f) end

---@type Foo
local foo = {};

local bar = toBar(foo:getChild('Hello'));

Expected behavior
I don't think this code have any problem but the diagnostics pops an error like this

image (1)

Screenshots
all the screenshots are included above.

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? what's this?
  • Client: VSCode

Additional context

And if I redirect the call with divide the getChild call into a variable like below, It does not raise any error.

화면 캡처 2022-06-17 155458

Provide logs

@sumneko sumneko added the bug Something isn't working label Jun 17, 2022
@HeeMyung
Copy link
Author

@sumneko you are the best! :)

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

2 participants