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

让@overload影响实现 #1582

Closed
xiangnanscu opened this issue Sep 22, 2022 · 2 comments
Closed

让@overload影响实现 #1582

xiangnanscu opened this issue Sep 22, 2022 · 2 comments
Labels
enhancement New feature or request feat/type check Related to the type checking feature
Milestone

Comments

@xiangnanscu
Copy link

如下定义,然后 return nil, 'some error'不会有波浪线提示错误

---@return string, number
---@overload fun(): nil, string
local function foo11()
  do
    return 'foo', 1
  end

  do
    return nil, 'some error'
  end
end

讨论见:
#1579

@sumneko sumneko added this to the 3.6.0 milestone Sep 22, 2022
@sumneko sumneko added enhancement New feature or request feat/type check Related to the type checking feature labels Sep 22, 2022
@xiangnanscu
Copy link
Author

@sumneko 你好,3.5.6这个feature还是没有生效呢?

---@param x boolean
---@return number
---@overload fun(): boolean, boolean
local function f(x)
  if x then
    return 1
  else
    return false, false
  end
end

f()

image

@sumneko
Copy link
Collaborator

sumneko commented Nov 5, 2022

等3.6.0

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