Skip to content

List of generic function mismatches when passed as parameter #896

Closed

Description

@corpserot
Image
---@alias MyFnA fun(): number
---@alias MyFnB<T> fun(): T
---@alias MyFnC<T> fun(): number

local aaa ---@type MyFnA[]
---@param aaa MyFnA[]
local function AAA(aaa) return aaa end
local _ = AAA(aaa) -- 🟢

local bbb1 ---@type (MyFnB<number>)[]
local bbb2 = { function() return 1 end } ---@type (MyFnB<number>)[]
---@param bbb (MyFnB<number>)[]
local function BBB(bbb) return bbb end
local _ = BBB(bbb1) -- 🔴
local _ = BBB(bbb2) -- 🔴

local ccc1 ---@type (MyFnC<number>)[]
local ccc2 = { function() return 1 end } ---@type (MyFnC<number>)[]
---@param ccc (MyFnC<number>)[]
local function CCC(ccc) return ccc end
local _ = CCC(ccc1) -- 🔴
local _ = CCC(ccc2) -- 🔴

Activity

  1. added theissue type on Dec 24, 2025
  2. self-assigned this
    on Dec 24, 2025
  3. xuhuanzy commented on Dec 24, 2025

    @xuhuanzy
    Member

    It seems to be an issue with the configuration item strict.requirePath.

  4. added a commit that references this issue on Dec 24, 2025
    b032896
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions