Skip to content

meta: improve typing for unpack #2587

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 18, 2024
Merged

meta: improve typing for unpack #2587

merged 1 commit into from
Apr 18, 2024

Conversation

lewis6991
Copy link
Contributor

@lewis6991 lewis6991 commented Mar 26, 2024

Fixes #1353

Not sure if this is the best way to fix this problem, but it does remove many false diagnostics from our codebase.

@sumneko
Copy link
Collaborator

sumneko commented Apr 17, 2024

Maybe just change it to params table and returns ...

@lewis6991
Copy link
Contributor Author

lewis6991 commented Apr 17, 2024

That's what the definition above does, which fails to properly propagate types on code like:

local a, b = unpack({'a', 2})

Where:

  • a should be inferred as a string
  • b should be inferred as an integer.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Infer types from unpack call
2 participants