Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

function types don't fully work

Open
#1,308 0 comments 0 reactions 0 assignees View on GitHub

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

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EmmyLuaLs/emmylua-analyzer-rust

All issues in EmmyLuaLs/emmylua-analyzer-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.