function types don't fully work
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 53/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- developer-experience
Research direction
The report shows two failures in EmmyLua function type annotations: return checking is skipped for an annotated function value, and parameter hovers show any for the documented fun(x: number, y: number): number example. Start by locating the analyzer code and tests for function type annotations and hover information. Done means both examples enforce the declared return type and show number for x and y.
Written by the indexing model from the issue text.
Description
I'm using emmylua_ls 0.23.1, when I do
---@return string
local function foo()
return 12
end
I get the warning that I don't return a string. When instead I do
---@type fun():string
local bar = function()
return 12
end
Then there is no warning at all.
In fact, when using one of the examples from https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/main/docs/emmylua_doc/annotations_EN/type.md#examples
-- Function types
---@type fun(x: number, y: number): number
local addFunction = function(x, y)
return x + y
end
A hover on x and y reveals any, and not number.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 104
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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 72/100
EmmyLuaLs/emmylua-analyzer-rust#1276 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
EmmyLuaLs/emmylua-analyzer-rust#1249 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EmmyLuaLs/emmylua-analyzer-rust#1247 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
EmmyLuaLs/emmylua-analyzer-rust#1016 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
EmmyLuaLs/emmylua-analyzer-rust#1303 ·
Maintainers usually reply within 1 day
All issues in EmmyLuaLs/emmylua-analyzer-rust
Similar issues
-
C-bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
rust-lang/rust-analyzer#23547 ·
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenZeppelin/guardian#570 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation priority:p2 type:chore
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
facebookincubator/scrut#60 ·