Result of `table.pack` is of a union instead of an intersection type
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Start in crates/emmylua_code_analysis/resources/std/table.lua at line 122 and inspect the return annotation for table.pack. Update the annotation so the packed tuple and the { n: integer } field are represented as an intersection, then verify that conditional index accesses no longer produce the reported type-checker complaint.
Written by the indexing model from the issue text.
Description
Currently, the type-checker complains about index accesses of a table.pack result inside condition branches that check that field n is not nil.
https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/381d67737fd068a9056572716461219d28aa9c23/crates/emmylua_code_analysis/resources/std/table.lua#L122
should be instead:
---@return [T...] & { n: integer }
- Dominant language
- Rust
- Stars
- 507
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EmmyLuaLs/emmylua-analyzer-rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
EmmyLuaLs/emmylua-analyzer-rust#1249 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EmmyLuaLs/emmylua-analyzer-rust#1247 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
EmmyLuaLs/emmylua-analyzer-rust#1253 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
EmmyLuaLs/emmylua-analyzer-rust#1251 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
EmmyLuaLs/emmylua-analyzer-rust#1250 ·
All issues in EmmyLuaLs/emmylua-analyzer-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100