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

mismatching object literal type doesn't raise linting error #1434

Closed
xiangnanscu opened this issue Aug 3, 2022 · 0 comments
Closed

mismatching object literal type doesn't raise linting error #1434

xiangnanscu opened this issue Aug 3, 2022 · 0 comments
Labels
enhancement New feature or request feat/type check Related to the type checking feature
Milestone

Comments

@xiangnanscu
Copy link

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows WSL

What is the issue affecting?

Type Checking

Expected Behaviour

should show linting error

Actual Behaviour

doesn't show error

Reproduction steps

---@param opts {a:number, b:number}
local function foo(opts)

end

---@param opts {c:number, d:number}
local function bar(opts)
  foo(opts)  -- this should raise linting error
end

considering the ts equivalent:

function foo(opts:{a:number,b:number}) {

}
function bar(opts:{c:number,d:number}) {
  foo(opts)
}

Additional Notes

No response

Log File

No response

@sumneko sumneko added enhancement New feature or request feat/type check Related to the type checking feature labels Aug 3, 2022
@sumneko sumneko added this to the 3.6.0 milestone Sep 19, 2022
@sumneko sumneko closed this as completed in 9be846d Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat/type check Related to the type checking feature
Projects
None yet
Development

No branches or pull requests

2 participants