Skip to content

type narrowing with alias #373

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
lewis6991 opened this issue Apr 17, 2025 · 0 comments · Fixed by #404
Closed

type narrowing with alias #373

lewis6991 opened this issue Apr 17, 2025 · 0 comments · Fixed by #404

Comments

@lewis6991
Copy link
Collaborator

Image
--- @alias myalias string|string[]

--- @param x myalias
function foo(x)
  if type(x) == 'string' then
    return
  elseif type(x) == 'table' then
    for _, t in ipairs(x) do
    end
  end
end
xuhuanzy added a commit to xuhuanzy/emmylua-analyzer-rust that referenced this issue Apr 30, 2025
@xuhuanzy xuhuanzy mentioned this issue Apr 30, 2025
xuhuanzy added a commit to xuhuanzy/emmylua-analyzer-rust that referenced this issue Apr 30, 2025
xuhuanzy added a commit to xuhuanzy/emmylua-analyzer-rust that referenced this issue Apr 30, 2025
@CppCXY CppCXY closed this as completed in 2a67d7b Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant